Bug 53197 - [4.8 Regression] bootstrap comparison failure
Summary: [4.8 Regression] bootstrap comparison failure
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: bootstrap (show other bugs)
Version: 4.8.0
: P3 normal
Target Milestone: ---
Assignee: Michael Matz
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-05-02 18:12 UTC by H.J. Lu
Modified: 2012-05-03 02:35 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2012-05-02 00:00:00


Attachments
auto-host.h on Fedora/15/x86-64 (7.27 KB, application/octet-stream)
2012-05-03 00:02 UTC, H.J. Lu
Details

Note You need to log in before you can comment on or make changes to this bug.
Description H.J. Lu 2012-05-02 18:12:23 UTC
On Linux/ia32, revision 187054 gave

make[6]: Leaving directory `/export/gnu/import/git/gcc-test-ia32corei7/bld'
Comparing stages 2 and 3
warning: gcc/cc1obj-checksum.o differs
warning: gcc/cc1plus-checksum.o differs
warning: gcc/cc1-checksum.o differs
Bootstrap comparison failure!
gcc/tree-ssa-math-opts.o differs
gcc/tree-cfg.o differs
gcc/tree-emutls.o differs
gcc/tree-if-conv.o differs
gcc/tree-cfgcleanup.o differs
gcc/tree-ssa-live.o differs
gcc/tree-object-size.o differs
gcc/trans-mem.o differs
gcc/tree-sra.o differs
gcc/tree-inline.o differs
make[5]: *** [compare] Error 1

when configured with

--with-arch=corei7 --with-cpu=corei7 --prefix=/usr/local --enable-clocale=gnu --with-system-zlib --enable-shared --with-demangler-in-ld i686-linux --with-fpmath=sse --enable-languages=c,c++,fortran,java,lto,objc

Revision 187051 is OK.
Comment 1 Uroš Bizjak 2012-05-02 18:21:34 UTC
Also fails on x86_64-pc-linux-gnu, without any configure flags.
Comment 2 Uroš Bizjak 2012-05-02 18:39:49 UTC
r187051 is OK.
r187054 fails.

It is Michael's mega patch:
http://gcc.gnu.org/viewcvs?view=revision&revision=187053
Comment 3 Michael Matz 2012-05-02 21:29:24 UTC
Hmpf, x86_64-linux works for me just fine.
Hopefully I can reproduce the 32bit bootstrap fail :-/
Comment 4 Jonathan Wakely 2012-05-02 22:17:26 UTC
Definitely affects x86_64-unknown-linux-gnu too, my bootstrap failed with this config:

/home/jwakely/src/gcc/configure --prefix=/home/jwakely/gcc/4.x --with-system-zlib --with-gnu-ld --with-gnu-as --disable-libitm --disable-libquadmath --disable-libmudflap --enable-libstdcxx-debug --enable-libstdcxx-time=rt --enable-languages=c,c++

It builds OK with --disable-bootstrap though
Comment 5 Michael Matz 2012-05-02 22:21:31 UTC
Without help this will be impossible to debug for me.  I can't reproduce with
either x86_64-linux (no configure options), nor under linux32 personality
(without options and with HJs options); I tried on two machines (in Intel, one
AMD).

Uros and Jonathan: does it fail in the same way as for HJ?  I.e. same
miscomparing files?
Comment 6 H.J. Lu 2012-05-02 22:23:37 UTC
(In reply to comment #5)
> Without help this will be impossible to debug for me.  I can't reproduce with
> either x86_64-linux (no configure options), nor under linux32 personality
> (without options and with HJs options); I tried on two machines (in Intel, one
> AMD).

Are you using binutils 2.22 or newer?
Comment 7 Uroš Bizjak 2012-05-02 22:27:50 UTC
(In reply to comment #5)
> Without help this will be impossible to debug for me.  I can't reproduce with
> either x86_64-linux (no configure options), nor under linux32 personality
> (without options and with HJs options); I tried on two machines (in Intel, one
> AMD).
> 
> Uros and Jonathan: does it fail in the same way as for HJ?  I.e. same
> miscomparing files?

Yes, they are the same:

Comparing stages 2 and 3
warning: gcc/cc1-checksum.o differs
warning: gcc/cc1plus-checksum.o differs
Bootstrap comparison failure!
gcc/tree-cfgcleanup.o differs
gcc/tree-sra.o differs
gcc/tree-emutls.o differs
gcc/tree-if-conv.o differs
gcc/trans-mem.o differs
gcc/tree-ssa-math-opts.o differs
gcc/tree-object-size.o differs
gcc/tree-ssa-live.o differs
gcc/tree-cfg.o differs
gcc/tree-inline.o differs
gmake[2]: *** [compare] Error 1

FYI, my binutils are: GNU ld version 2.21.53.0.1-6.fc16 20110716
Comment 8 Michael Matz 2012-05-02 22:29:17 UTC
(In reply to comment #6)
> 
> Are you using binutils 2.22 or newer?

No: binutils-2.21.1-60.1.x86_64 .
Comment 9 H.J. Lu 2012-05-02 22:33:12 UTC
(In reply to comment #8)
> (In reply to comment #6)
> > 
> > Are you using binutils 2.22 or newer?
> 
> No: binutils-2.21.1-60.1.x86_64 .

Please try binutils 2.22.
Comment 10 Jonathan Wakely 2012-05-02 22:39:48 UTC
Same files:

Comparing stages 2 and 3
warning: gcc/cc1plus-checksum.o differs
warning: gcc/cc1-checksum.o differs
Bootstrap comparison failure!
gcc/tree-ssa-math-opts.o differs
gcc/tree-cfgcleanup.o differs
gcc/tree-ssa-live.o differs
gcc/trans-mem.o differs
gcc/tree-inline.o differs
gcc/tree-object-size.o differs
gcc/tree-emutls.o differs
gcc/tree-if-conv.o differs
gcc/tree-cfg.o differs
gcc/tree-sra.o differs
make[2]: *** [compare] Error 1
make[2]: Leaving directory `/home/jwakely/build'
make[1]: *** [stage3-bubble] Error 2
make[1]: Leaving directory `/home/jwakely/build'
make: *** [all] Error 2

That's on gcc20 in the compile farm, using
GNU assembler (GNU Binutils for Debian) 2.20.1-system.20100303
Comment 11 Michael Matz 2012-05-02 22:53:21 UTC
(In reply to comment #9)
> > > Are you using binutils 2.22 or newer?
> > 
> > No: binutils-2.21.1-60.1.x86_64 .
> 
> Please try binutils 2.22.

Even though Jonathan uses 2.20 and also has broken bootstrap?  In any case
also with Jonathans options I don't reproduce a segfault.

I'll try binutils 2.22 now.
Comment 12 Michael Matz 2012-05-02 23:22:26 UTC
(In reply to comment #11)
> 
> I'll try binutils 2.22 now.

Doesn't help, still no miscompare :-/
Comment 13 H.J. Lu 2012-05-03 00:02:26 UTC
Created attachment 27294 [details]
auto-host.h on Fedora/15/x86-64

Here is auto-host.h on Fedora/15/x86-64.  How does it compare
against yours?
Comment 14 Michael Matz 2012-05-03 00:13:16 UTC
Thanks to Jonathan I have a hunch now.  He has BUILD_CONFIG=bootstrap-debug
whereas I have BUILD_CONFIG empty for all my machines.

This means that for him stage2 is built with -g -gtoggle (effectively switching
off -g again), and stage3 with -g, and the compares then do the comparison
ignoring the debug info.

For me stage2 and stage3 are built with -g.  The -g switch seems to influence
code generation with my patch (I tested that compiling the stage3 file
on the broken tree with -gtoggle produces the same as the stage2 file),
which of course is a bug.  But I haven't seen it because all my files are
built with -g.

Now, as to why for me BUILD_CONFIG isn't bootstrap-debug: configure.ac
activates this by default, but then checks if contrib/compare-debug
actually works for comparing a debug and non-debug .o file.  And for
SuSE systems it doesn't, because our system compilers encode some command
line options (among them -g) into a special .comment section.

In any case, this code difference for -g vs. non-g has to be fixed, which
I'm in the process of doing.
Comment 15 Michael Matz 2012-05-03 02:32:13 UTC
Author: matz
Date: Thu May  3 02:32:08 2012
New Revision: 187074

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=187074
Log:
	PR bootstrap/53197
	* tree-ssa-dse.c (dse_optimize_stmt): Take pointer to
	iterator.
	(dse_enter_block): Properly iterate the whole sequence even
	if the last statement was removed.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/tree-ssa-dse.c
Comment 16 Michael Matz 2012-05-03 02:35:36 UTC
Should be fixed.