GCC4.3.3: Bootstrap comparison failure!

2009-05-20 Thread chenyang
Hi everyone,

I got a "Bootstrap comparison failure!" error when building gcc 4.3.3:


Comparing stages 2 and 3
warning: ./cc1-checksum.o differs
warning: ./cc1plus-checksum.o differs
Bootstrap comparison failure!
./tree-cfg.o differs
./double-int.o differs
./gimple-low.o differs
./tree-into-ssa.o differs
./tree-ssa-loop-unswitch.o differs
...omit...
./langhooks.o differs
...omit...
./tree-dfa.o differs
./tree-nomudflap.o differs
make[2]: *** [compare] Error 1
make[2]: Leaving directory `/bwdata/testuser/repo/build-gcc-4.3.3-by-gcc-3.3.3'
make[1]: *** [stage3-bubble] Error 2
make[1]: Leaving directory `/bwdata/testuser/repo/build-gcc-4.3.3-by-gcc-3.3.3'
make: *** [all] Error 2


My configuration is:
   -Linux gnode2 2.6.5-7.97-smp #1 SMP Fri Jul 2 14:21:59 UTC 2004
x86_64 x86_64 x86_64 GNU/Linux
   -SUSE LINUX Enterprise Server 9 (x86_64)
   -gcc 3.3.3
   -gmp 4.2.2, mpfr 2.3.0

the configure cmd is:
../gcc-4.3.3/configure --prefix=/home/testuser/tools/gcc-4.3.3
   --with-gmp=/home/testuser/tools/gmp-4.2.2
   --with-mpfr=/home/testuser/tools/mpfr-2.3.0/
   --enable-languages=c,c++,fortran

And I found a strange problem when I tried to use the stage1-gcc/xgcc to compile
langhooks.c (langhooks.o differs at the final comparison) manually. I used the
following command to compile it twice, and compare the two produced langhooks.o.
To my surprise, the two langhooks.o were not identical:

In directory stage2-gcc, I issued the following cmd to produce langhooks1.o.
>/home/testuser/repo/build-gcc-4.3.3-by-gcc-3.3.3/stage1-gcc/xgcc 
>-B/home/testuser/repo/build-gcc-4.3.3-by-gcc
-3.3.3/./stage1-gcc/
-B/home/testuser/tools/gcc-4.3.3/x86_64-unknown-linux-gnu/bin/ -c  -g
-O2 -DIN_GCC   -W -Wall -Wwr
ite-strings -Wstrict-prototypes -Wmissing-prototypes
-Wold-style-definition -Wmissing-format-attribute -pedantic
-Wno-long-lo
ng -Wno-variadic-macros -Wno-overlength-strings
-DHAVE_CONFIG_H -I. -I. -I../../gcc-4.3.3/gcc -I../../gcc-4.3.
3/gcc/. -I../../gcc-4.3.3/gcc/../include
-I../../gcc-4.3.3/gcc/../libcpp/include
-I/home/testuser/tools/gmp-4.2.2/inc
lude -I/home/testuser/tools/mpfr-2.3.0-by-gcc-3.3.3//include
-I../../gcc-4.3.3/gcc/../libdecnumber -I../../gcc-4.3.3/
gcc/../libdecnumber/bid -I../libdecnumber
../../gcc-4.3.3/gcc/langhooks.c -o langhooks1.o

then, I issued the same cmd to produce langhooks2.o
>/home/testuser/repo/build-gcc-4.3.3-by-gcc-3.3.3/stage1-gcc/xgcc 
>-B/home/testuser/repo/build-gcc-4.3.3-by-gcc
-3.3.3/./stage1-gcc/
-B/home/testuser/tools/gcc-4.3.3/x86_64-unknown-linux-gnu/bin/ -c -g
-O2 -DIN_GCC   -W -Wall -Wwr
ite-strings -Wstrict-prototypes -Wmissing-prototypes
-Wold-style-definition -Wmissing-format-attribute -pedantic
-Wno-long-lo
ng -Wno-variadic-macros -Wno-overlength-strings
-DHAVE_CONFIG_H -I. -I. -I../../gcc-4.3.3/gcc -I../../gcc-4.3.
3/gcc/. -I../../gcc-4.3.3/gcc/../include
-I../../gcc-4.3.3/gcc/../libcpp/include
-I/home/testuser/tools/gmp-4.2.2/inc
lude -I/home/testuser/tools/mpfr-2.3.0-by-gcc-3.3.3//include
-I../../gcc-4.3.3/gcc/../libdecnumber -I../../gcc-4.3.3/
gcc/../libdecnumber/bid -I../libdecnumber
../../gcc-4.3.3/gcc/langhooks.c -o langhooks2.o

finally, I compared langhooks1.o langhooks2.o
>cmp -i 16 langhooks1.o langhooks2.o
langhooks1.o langhooks2.o differ: byte 76626, line 514

And I have successfully built gcc 4.0.0 and gcc 4.1.2 on the same
machine, but failed to build gcc 4.2.4 with the same
"Bootstrap comparison failure!" problem.
I have also tried to use gcc 4.0.0 to build gcc 4.3.3 on the same
machine, but also failed with the same problem.

Any suggestions?

Thanks in advance.


Re: GCC4.3.3: Bootstrap comparison failure!

2009-05-21 Thread chenyang
Thanks, Ian,

> These kinds of issues are always difficult to debug.  There have been a
> couple of patches to stabilize different sorts which I don't think are
> in 4.3.3.  That could conceivably cause differences if address space
> randomization is turned on.  I don't know of any specific bug reports,
> though.  In any case, try turning off address space randomization
> (/proc/sys/kernel/randomize_va_space).
There is no "/proc/sys/kernel/randomize_va_space" in my system.
Maybe it is a little too old: 2.6.5-7.97-smp #1 SMP Fri Jul 2 14:21:59 UTC 2004


>> finally, I compared langhooks1.o langhooks2.o
>>>cmp -i 16 langhooks1.o langhooks2.o
>> langhooks1.o langhooks2.o differ: byte 76626, line 514
>
> Try running your commands with the --save-temps options and compare the
> resulting .s files.  Also, try running the commands with the
> -fdump-tree-all -fdump-rtl-all options and see where the dump files
> first differ.
>
I tried --save-temps and the resulting .s files were identical.
I found that the problem was introduced by "as".
I ran "as" twice with the same arguments. The two resulting .o files
were different.
I upgraded the binutils to the latest version: 2.19. The problem
hasn't gone away.

Do you have any ideas?


Re: GCC4.3.3: Bootstrap comparison failure!

2009-05-22 Thread chenyang
>> I tried --save-temps and the resulting .s files were identical.
>> I found that the problem was introduced by "as".
>> I ran "as" twice with the same arguments. The two resulting .o files
>> were different.
>> I upgraded the binutils to the latest version: 2.19. The problem
>> hasn't gone away.
>
> That is very unusual and certainly indicates a bug in the assembler.
> Please file a bug against the GNU binutils at
> http://sourceware.org/bugzilla/ .  Attach your assembler file to the
> bug.  Thanks.
>
Ok. And it seems to be a system-specific bug. I even can't reproduce
it on a more
recent AMD machine with the same .s file and the same static linked "as" binary
. You can see more details at
http://sourceware.org/ml/binutils/2009-05/msg00337.html. It's really
unusual.

Thanks.