gcc -S vs clang -S

Eric Botcazou ebotcazou@libertysurf.fr
Tue May 12 15:30:00 GMT 2015

> Note that at -O3 there is a difference still:
> clang (3.6.0):
>         addl    %esi, %edi
>         movl    %edi, %eax
>         retq
> gcc (4.9.2)
>         leal    (%rdi,%rsi), %eax
>         ret
> Can't tell which is best, if any.

But what's your point exactly here?  You cannot expect different compilers to 
generate exactly the same code on a given testcase for non-toy architectures.

Note that this kind of discussion is more appropriate for gcc-help@gcc.gnu.org

Eric Botcazou

More information about the Gcc mailing list