[Bug c++/14412] New: [regression] generates different object file when run on the same source

ckirby at laurelnetworks dot com gcc-bugzilla@gcc.gnu.org
Wed Mar 3 17:46:00 GMT 2004


Given the same source file, gcc generates a different .o file every time it is
run.  I have verified that it works correctly in 3.3.  The problem has been
verified in both 3.3.2 and 3.3.3.

command line:
$ /u/lni/gcc/3.3.3/i686-pc-linux-gnu/bin/i686-pc-linux-gnulibc2.2-g++ -c
src/system/trace/example.c++ -o t1.o
$ /u/lni/gcc/3.3.3/i686-pc-linux-gnu/bin/i686-pc-linux-gnulibc2.2-g++ -c
src/system/trace/example.c++ -o t2.o
$ sum t1.o t2.o
07738     1 t1.o    
40330     1 t2.o

example.c++:

namespace
{
    class Example
    {
    public:
        Example();
    };

    Example::Example()
    {
    }
}

Here is the difference in the objdump output:
$ objdump -D t1.o > od.t1
$ objdump -D t2.o > od.t2
$ diff -du od.t1 od.t2
--- od.t1       2004-03-03 12:40:06.000000000 -0500
+++ od.t2       2004-03-03 12:40:10.000000000 -0500
@@ -1,16 +1,16 @@
  
-t1.o:     file format elf32-i386
+t2.o:     file format elf32-i386
  
 Disassembly of section .text:
  
-00000000 <_ZN45_GLOBAL__N_src_system_trace_example.c__lmRQEb7ExampleC2Ev>:
+00000000 <_ZN45_GLOBAL__N_src_system_trace_example.c__N4Abhc7ExampleC2Ev>:
    0:  55                      push   %ebp
    1:  89 e5                   mov    %esp,%ebp
    3:  5d                      pop    %ebp
    4:  c3                      ret
    5:  90                      nop
  
-00000006 <_ZN45_GLOBAL__N_src_system_trace_example.c__lmRQEb7ExampleC1Ev>:
+00000006 <_ZN45_GLOBAL__N_src_system_trace_example.c__N4Abhc7ExampleC1Ev>:
    6:  55                      push   %ebp
    7:  89 e5                   mov    %esp,%ebp
    9:  5d                      pop    %ebp


$ /u/lni/gcc/3.3.3/i686-pc-linux-gnu/bin/i686-pc-linux-gnulibc2.2-g++ -v
Reading specs from
/u/lni/gcc/3.3.3/i686-pc-linux-gnu/lib/gcc-lib/i686-pc-linux-gnulibc2.2/3.3.3/specs
Configured with: ../../../src/gcc/configure --host=i686-pc-linux-gnu
--target=i686-pc-linux-gnulibc2.2
--with-headers=../../../src/gcc/../sys-root/i686-pc-linux-gnulibc2.2/sys-include
--with-libs=../../../src/gcc/../sys-root/i686-pc-linux-gnulibc2.2/libs
--prefix=/u/lni/gcc/3.3.3/i686-pc-linux-gnu --enable-threads=posix
--enable-long-long --enable-shared
Thread model: posix
gcc version 3.3.3

-- 
           Summary: [regression] generates different object file when run on
                    the same source
           Product: gcc
           Version: 3.3.3
            Status: UNCONFIRMED
          Severity: critical
          Priority: P1
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: ckirby at laurelnetworks dot com
                CC: gcc-bugs at gcc dot gnu dot org


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



More information about the Gcc-bugs mailing list