This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/29493] New: -masm=intel - does not emit right asm code


$ cat main.c
int main() {
        return 0;
}

$ gcc -v -save-temps -S -masm=intel main.c -Wa,al
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: ../gcc-4.1.1/configure --prefix=/usr --enable-shared
--enable-languages=c,c++,objc --enable-threads=posix --enable-__cxa_atexit
--disable-multilib --libdir=/usr/lib --enable-clocale=gnu
Thread model: posix
gcc version 4.1.1
 /usr/libexec/gcc/i686-pc-linux-gnu/4.1.1/cc1 -E -quiet -v main.c -masm=intel
-mtune=pentiumpro -fpch-preprocess -o main.i
ignoring nonexistent directory
"/usr/lib/gcc/i686-pc-linux-gnu/4.1.1/../../../../i686-pc-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/include
 /usr/lib/gcc/i686-pc-linux-gnu/4.1.1/include
 /usr/include
End of search list.
 /usr/libexec/gcc/i686-pc-linux-gnu/4.1.1/cc1 -fpreprocessed main.i -quiet
-dumpbase main.c -masm=intel -mtune=pentiumpro -auxbase main -version -o main.s
GNU C version 4.1.1 (i686-pc-linux-gnu)
        compiled by GNU C version 4.1.1.
GGC heuristics: --param ggc-min-expand=63 --param ggc-min-heapsize=62408
Compiler executable checksum: 22edf66e2a6729efc57467b56c8043ae

$ cat main.s
        .file   "main.c"
        .intel_syntax
        .text
.globl main
        .type   main, @function
main:
        lea     %ecx, [%esp+4]
        and     %esp, -16
        push    DWORD PTR [%ecx-4]
        push    %ebp
        mov     %ebp, %esp
        push    %ecx
        mov     %eax, 0
        pop     %ecx
        pop     %ebp
        lea     %esp, [%ecx-4]
        ret
        .size   main, .-main
        .ident  "GCC: (GNU) 4.1.1"
        .section        .note.GNU-stack,"",@progbits

These register names are plain not-intel like.

I was able to reproduce it on:
GCC: (GNU) 4.0.3 (Ubuntu 4.0.3-1ubuntu5)

If I'm not wrong somewhere - this is a bug. Hope it'll be easy to fix or is
even fixed in experimental versions - I have no way to test that.


-- 
           Summary: -masm=intel - does not emit right asm code
           Product: gcc
           Version: 4.1.1
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: dawid dot ciezarkiewicz at gmail dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29493


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]