[Bug c/28792] New: Incorrect i386 code for inlined function with -O2 -mtune=generic
gcc 4.1.1 generates incorrect 386 code with -O2 or -O3 flag for an inlined function if the -mtune cpu-type is one of: generic, i586, i686, pentium2, pentium3, pentium-m. The generated code seems to be correct for the following cpu-types: i386, i486, pentium4 prescott. The problem is also present in gcc version 3.4.4 (cygming special). -- Summary: Incorrect i386 code for inlined function with -O2 - mtune=generic Product: gcc Version: 4.1.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: chiabaut at nortel dot com GCC host triplet: i386-redhat-linux GCC target triplet: i386-redhat-linux http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28792
[Bug c/28792] Incorrect i386 code for inlined function with -O2 -mtune=generic
--- Comment #1 from chiabaut at nortel dot com 2006-08-21 15:16 --- Created an attachment (id=12110) -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=12110action=view) C source file -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28792
[Bug c/28792] Incorrect i386 code for inlined function with -O2 -mtune=generic
--- Comment #2 from chiabaut at nortel dot com 2006-08-21 15:20 --- gcc -v -save-temps -g -Wall -O2 -mtune=generic bug.c Using built-in specs. Target: i386-redhat-linux Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-libgcj-multifile --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk --disable-dssi --with-java-home=/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre --with-cpu=generic --host=i386-redhat-linux Thread model: posix gcc version 4.1.1 20060525 (Red Hat 4.1.1-1) /usr/libexec/gcc/i386-redhat-linux/4.1.1/cc1 -E -quiet -v bug.c -mtune=generic -Wall -fworking-directory -O2 -fpch-preprocess -o bug.i ignoring nonexistent directory /usr/lib/gcc/i386-redhat-linux/4.1.1/../../../../i386-redhat-linux/include #include ... search starts here: #include ... search starts here: /usr/local/include /usr/lib/gcc/i386-redhat-linux/4.1.1/include /usr/include End of search list. /usr/libexec/gcc/i386-redhat-linux/4.1.1/cc1 -fpreprocessed bug.i -quiet -dumpbase bug.c -mtune=generic -auxbase bug -g -O2 -Wall -version -o bug.s GNU C version 4.1.1 20060525 (Red Hat 4.1.1-1) (i386-redhat-linux) compiled by GNU C version 4.1.1 20060525 (Red Hat 4.1.1-1). GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 Compiler executable checksum: 7a31534f101210f86e6343d2c0c239f8 as -V -Qy -o bug.o bug.s GNU assembler version 2.16.91.0.6 (i386-redhat-linux) using BFD version 2.16.91.0.6 20060212 /usr/libexec/gcc/i386-redhat-linux/4.1.1/collect2 --eh-frame-hdr -m elf_i386 -dynamic-linker /lib/ld-linux.so.2 /usr/lib/gcc/i386-redhat-linux/4.1.1/../../../crt1.o /usr/lib/gcc/i386-redhat-linux/4.1.1/../../../crti.o /usr/lib/gcc/i386-redhat-linux/4.1.1/crtbegin.o -L/usr/lib/gcc/i386-redhat-linux/4.1.1 -L/usr/lib/gcc/i386-redhat-linux/4.1.1 -L/usr/lib/gcc/i386-redhat-linux/4.1.1/../../.. bug.o -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/lib/gcc/i386-redhat-linux/4.1.1/crtend.o /usr/lib/gcc/i386-redhat-linux/4.1.1/../../../crtn.o -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28792