When using gcc 3.3.3 on a Linux machine, the -O3 option is removing the static const char* strings we use to identify file versions. This behavior is different than how the 3.2.3 versions behave. Below is the relevant output that shows the differences between the 2 versions.
devbal801:<~/TEST> rm -f a.out devbal801:<~/TEST> cat test.c #include <stdio.h> static const char *rcsid2 = "$Header: Header information $"; int main() { printf("Hello World\n"); } devbal801:<~/TEST> gcc -v -save-temps -O3 test.c Reading specs from /usr/lib/gcc-lib/i586-suse-linux/3.3.3/specs Configured with: ../configure --enable-threads=posix --prefix=/usr --with-local- prefix=/usr/local --infodir=/usr/share/info --mandir=/usr/share/man --enable- languages=c,c++,f77,objc,java,ada --disable-checking --libdir=/usr/lib --enable- libgcj --with-gxx-include-dir=/usr/include/g++ --with-slibdir=/lib --with- system-zlib --enable-shared --enable-__cxa_atexit i586-suse-linux Thread model: posix gcc version 3.3.3 (SuSE Linux) /usr/lib/gcc-lib/i586-suse-linux/3.3.3/cc1 -E -quiet -v -D__GNUC__=3 - D__GNUC_MINOR__=3 -D__GNUC_PATCHLEVEL__=3 test.c -O3 test.i ignoring nonexistent directory "/usr/local/include" #include "..." search starts here: #include <...> search starts here: /usr/lib/gcc-lib/i586-suse-linux/3.3.3/include /usr/i586-suse-linux/include /usr/include End of search list. /usr/lib/gcc-lib/i586-suse-linux/3.3.3/cc1 -fpreprocessed test.i -quiet - dumpbase test.c -auxbase test -O3 -version -o test.s GNU C version 3.3.3 (SuSE Linux) (i586-suse-linux) compiled by GNU C version 3.3.3 (SuSE Linux). GGC heuristics: --param ggc-min-expand=99 --param ggc-min-heapsize=129594 /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/as -V - Qy -o test.o test.s GNU assembler version 2.15.90.0.1.1 (i586-suse-linux) using BFD version 2.15.90.0.1.1 20040303 (SuSE Linux) /usr/lib/gcc-lib/i586-suse-linux/3.3.3/collect2 --eh-frame-hdr -m elf_i386 - dynamic-linker /lib/ld-linux.so.2 /usr/lib/gcc-lib/i586-suse- linux/3.3.3/../../../crt1.o /usr/lib/gcc-lib/i586-suse- linux/3.3.3/../../../crti.o /usr/lib/gcc-lib/i586-suse-linux/3.3.3/crtbegin.o - L/usr/lib/gcc-lib/i586-suse-linux/3.3.3 -L/usr/lib/gcc-lib/i586-suse- linux/3.3.3/../../../../i586-suse-linux/lib -L/usr/lib/gcc-lib/i586-suse- linux/3.3.3/../../.. test.o -lgcc -lgcc_eh -lc -lgcc -lgcc_eh /usr/lib/gcc- lib/i586-suse-linux/3.3.3/crtend.o /usr/lib/gcc-lib/i586-suse- linux/3.3.3/../../../crtn.o devbal801:<~/TEST> ident a.out a.out: ident: (warning) no id keywords in a.out devbal801:<~/TEST> rm -f a.out devbal801:<~/TEST> /usr/local/gcc/gcc-3.2.3/bin/gcc -v -save-temps -O3 test.c Reading specs from /usr/local/gcc/gcc-3.2.3/lib/gcc-lib/i686-pc-linux- gnu/3.2.3/specs Configured with: ./configure --prefix=/usr/local/gcc/gcc-3.2.3 Thread model: posix gcc version 3.2.3 /usr/local/gcc/gcc-3.2.3/lib/gcc-lib/i686-pc-linux-gnu/3.2.3/cpp0 -lang-c -v - D__GNUC__=3 -D__GNUC_MINOR__=2 -D__GNUC_PATCHLEVEL__=3 -D__GXX_ABI_VERSION=102 - D__ELF__ -Dunix -D__gnu_linux__ -Dlinux -D__ELF__ -D__unix__ -D__gnu_linux__ - D__linux__ -D__unix -D__linux -Asystem=posix -D__OPTIMIZE__ - D__STDC_HOSTED__=1 -Acpu=i386 -Amachine=i386 -Di386 -D__i386 -D__i386__ - D__tune_i686__ -D__tune_pentiumpro__ test.c test.i GNU CPP version 3.2.3 (cpplib) (i386 Linux/ELF) ignoring nonexistent directory "/usr/local/include" ignoring nonexistent directory "/usr/local/gcc/gcc-3.2.3/i686-pc-linux- gnu/include" #include "..." search starts here: #include <...> search starts here: /usr/local/gcc/gcc-3.2.3/include /usr/local/gcc/gcc-3.2.3/lib/gcc-lib/i686-pc-linux-gnu/3.2.3/include /usr/include End of search list. /usr/local/gcc/gcc-3.2.3/lib/gcc-lib/i686-pc-linux-gnu/3.2.3/cc1 - fpreprocessed test.i -quiet -dumpbase test.c -O3 -version -o test.s GNU CPP version 3.2.3 (cpplib) (i386 Linux/ELF) GNU C version 3.2.3 (i686-pc-linux-gnu) compiled by GNU C version 3.3.3 (SuSE Linux). as -V -Qy -o test.o test.s GNU assembler version 2.15.90.0.1.1 (i586-suse-linux) using BFD version 2.15.90.0.1.1 20040303 (SuSE Linux) /usr/local/gcc/gcc-3.2.3/lib/gcc-lib/i686-pc-linux-gnu/3.2.3/collect2 --eh- frame-hdr -m elf_i386 -dynamic-linker /lib/ld- linux.so.2 /usr/lib/crt1.o /usr/lib/crti.o /usr/local/gcc/gcc-3.2.3/lib/gcc- lib/i686-pc-linux-gnu/3.2.3/crtbegin.o -L/usr/local/gcc/gcc-3.2.3/lib/gcc- lib/i686-pc-linux-gnu/3.2.3 -L/usr/local/gcc/gcc-3.2.3/lib/gcc-lib/i686-pc- linux-gnu/3.2.3/../../.. test.o -lgcc -lgcc_eh -lc -lgcc - lgcc_eh /usr/local/gcc/gcc-3.2.3/lib/gcc-lib/i686-pc-linux- gnu/3.2.3/crtend.o /usr/lib/crtn.o devbal801:<~/TEST> ident a.out a.out: $Header: Header information $ devbal801:<~/TEST> uname -a Linux devbal801 2.6.5-7.97-default #1 Fri Jul 2 14:21:59 UTC 2004 i686 i686 i386 GNU/Linux devbal801:<~/TEST> -- Summary: Optimization -O3 removes static const char * ident strings Product: gcc Version: 3.3.3 Status: UNCONFIRMED Severity: normal Priority: P2 Component: rtl-optimization AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: Wempa at sig dot com CC: gcc-bugs at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23343