Mail Archives: djgpp/1994/10/15/19:13:28
>
>
> I was going over the asm output of a program and I came across this
> little snippet:
>
> movl %eax,-4(%ebp)
> movl -4(%ebp),%eax
>
> There wasn't a label in between or anything, just this totally useless
> instruction. This was with -O3.
> I've also come across silly little things like this:
>
> movl %eax,%edx
> sall %edx,6
> movl %edx,%eax
I have seen a post on comp.gcc.compilers a couple of months ago which said
that gcc version 2.6.0 had changed its register allocation order making edx
the primary working register. I can't check this out myself because I don't
have the compiler sources, somebody out there maybe could check it out (DJ?).
>
> instead of:
>
> sall %edx,6
> movl %eax,%edx
>
> Another useless instruction, but this one is a little more vague so I
> guess I can forgive the compiler (barely). But the first example is just
> ridiculous!
> Kim
>
Regards,
Per-Ola Nilsson
Sweden
- Raw text -