Bug 41324 - [4.5 Regression] Revision 151573 failed "make compare"
Summary: [4.5 Regression] Revision 151573 failed "make compare"
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: bootstrap (show other bugs)
Version: 4.5.0
: P3 normal
Target Milestone: 4.5.0
Assignee: Jakub Jelinek
URL:
Keywords:
: 41326 (view as bug list)
Depends on: 39779
Blocks:
  Show dependency treegraph
 
Reported: 2009-09-09 21:26 UTC by H.J. Lu
Modified: 2009-09-11 05:52 UTC (History)
4 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments
gcc45-pr41324.patch (354 bytes, patch)
2009-09-10 12:30 UTC, Jakub Jelinek
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description H.J. Lu 2009-09-09 21:26:07 UTC
On Linux/ia32, revision 151575 gave:

Comparing stages 2 and 3
warning: gcc/cc1plus-checksum.o differs
warning: gcc/cc1obj-checksum.o differs
warning: gcc/cc1-checksum.o differs
Bootstrap comparison failure!
gcc/gcov.o differs
gcc/gcov-dump.o differs
gcc/coverage.o differs
make[5]: *** [compare] Error 1
make[5]: Leaving directory `/export/gnu/import/svn/gcc-test/bld'
make[4]: *** [stage3-bubble] Error 2
make[4]: Leaving directory `/export/gnu/import/svn/gcc-test/bld'
make[3]: *** [bootstrap] Error 2
Comment 1 kargls 2009-09-09 23:50:37 UTC
*** Bug 41326 has been marked as a duplicate of this bug. ***
Comment 2 kargls 2009-09-09 23:52:20 UTC
Problem is also seen of i386-*-freebsd
Comment 3 H.J. Lu 2009-09-10 01:10:20 UTC
It was introduced between revision 151561 and revision 151575.
Comment 4 Jakub Jelinek 2009-09-10 10:05:26 UTC
I can reproduce this, and it appears the differences are between stage1 and stage2 compiled objects, not -g vs. -g -gtoggle.  Will try now a bootstrap without -gtoggle in STAGE2_CFLAGS.
Comment 5 Jakub Jelinek 2009-09-10 10:50:42 UTC
Even without -gtoggle it fails the same way.  For gcov.c (haven't looked at the other ones) the differences start between stage1 and stage2 cc1 in the bswap pass, in stage2 dump there is nothing (just ; Function lines), in stage1 dump there are some functions and several replacements made.  Looking into it.
Comment 6 Jakub Jelinek 2009-09-10 11:45:40 UTC
I bet the bug is in r151573, tree-ssa-math-opts.s difference between stage1 compiled tree-ssa-math-opts.c done using a day old stage1 cc1 and current stage1 cc1 is:
@@ -1050,7 +1050,7 @@ find_bswap_1:
        addl    $-1, 64(%esp)
        movl    %edx, 68(%esp)
        movl    64(%esp), %edx
-       adcl    $-1, 68(%esp)
+       adcl    $0, 68(%esp)
        movl    68(%esp), %ecx
        andl    %edx, (%edi)
        andl    %ecx, 4(%edi)
@@ -1368,7 +1368,7 @@ find_bswap_1:
        addl    $-1, 80(%esp)
        movl    %edx, 84(%esp)
        movl    80(%esp), %edx
-       adcl    $-1, 84(%esp)
+       adcl    $0, 84(%esp)
        movl    84(%esp), %ecx
        andl    (%edi), %edx
        andl    4(%edi), %ecx
@@ -1738,7 +1738,7 @@ execute_optimize_bswap:
        movl    40(%esp), %eax
        movl    %edx, 44(%esp)
        movl    40(%esp), %edx
-       adcl    $-1, 44(%esp)
+       adcl    $0, 44(%esp)
        movl    44(%esp), %ecx
        andl    $67305985, %eax
        movl    %eax, 56(%esp)
which strongly suggests the shifting got broken.
Comment 7 Jakub Jelinek 2009-09-10 12:09:32 UTC
Seems it is
convert_modes (DImode, DImode, (const_int -1), 1)
call.
It used to correctly return (const_int -1), now it returns
(const_double -1 [0xffffffff] 0 [0x0] 0 [0x0] 0 [0x0] 0 [0x0] 0 [0x0]).
Comment 8 Jakub Jelinek 2009-09-10 12:30:09 UTC
Created attachment 18562 [details]
gcc45-pr41324.patch

Patch I'm going to bootstrap/regtest.
Comment 9 H.J. Lu 2009-09-10 13:30:09 UTC
Revision 151573 is the cause.
Comment 10 Eric Botcazou 2009-09-10 13:41:50 UTC
(In reply to comment #8)
> Created an attachment (id=18562) [edit]
> gcc45-pr41324.patch
> 
> Patch I'm going to bootstrap/regtest.

So we now go through half of convert_modes to return the identity?  Very nice...
Comment 11 Jakub Jelinek 2009-09-10 14:02:57 UTC
If you want to revert the original convert_modes patch, sure, that's an option as well.  This patch fixed the bootstrap without the reversion though...
Comment 12 Eric Botcazou 2009-09-10 14:19:52 UTC
> If you want to revert the original convert_modes patch, sure, that's an option
> as well.  This patch fixed the bootstrap without the reversion though...

Right, but reverting an incorrect patch should be a pleasure. :-)
Comment 13 Jakub Jelinek 2009-09-10 14:29:37 UTC
I'll leave that decision to you RTL maintainers ;)

Anyway, without my patch I think even convert_modes (DImode, TImode, (const_int -1), 1) will return (const_double 0xffffffff) on 32-bit HWI hosts, which is definitely wrong.  I doubt anyone calls that routine with such arguments, but anyway.
Comment 14 H.J. Lu 2009-09-10 14:46:07 UTC
I think we should revert revision 151573 and find a better fix
for PR 39779.
Comment 15 Eric Botcazou 2009-09-11 05:52:52 UTC
Aforementioned patch has been reverted.