[Bug rtl-optimization/31944] [4.1/4.2/4.3 Regression] Endless loop while building a 64-bit 2.6.20 kernel
--- Comment #35 from ebotcazou at gcc dot gnu dot org 2008-01-14 12:22 --- On all branches. -- ebotcazou at gcc dot gnu dot org changed: What|Removed |Added URL||http://gcc.gnu.org/ml/gcc- ||patches/2008- ||01/msg00605.html Status|ASSIGNED|RESOLVED Resolution||FIXED http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31944
[Bug rtl-optimization/31944] [4.1/4.2/4.3 Regression] Endless loop while building a 64-bit 2.6.20 kernel
--- Comment #34 from ebotcazou at gcc dot gnu dot org 2008-01-14 12:20 --- Subject: Bug 31944 Author: ebotcazou Date: Mon Jan 14 12:19:58 2008 New Revision: 131524 URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=131524 Log: PR rtl-optimization/31944 * cse.c (remove_pseudo_from_table): New function. (merge_equiv_classes): Use above function to remove pseudo-registers. (invalidate): Likewise. Added: branches/gcc-4_1-branch/gcc/testsuite/gcc.c-torture/compile/20080114-1.c Modified: branches/gcc-4_1-branch/gcc/ChangeLog branches/gcc-4_1-branch/gcc/cse.c branches/gcc-4_1-branch/gcc/testsuite/ChangeLog -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31944
[Bug rtl-optimization/31944] [4.1/4.2/4.3 Regression] Endless loop while building a 64-bit 2.6.20 kernel
--- Comment #33 from ebotcazou at gcc dot gnu dot org 2008-01-14 12:19 --- Subject: Bug 31944 Author: ebotcazou Date: Mon Jan 14 12:18:30 2008 New Revision: 131523 URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=131523 Log: 2008-01-14 Eric Botcazou [EMAIL PROTECTED] PR rtl-optimization/31944 * cse.c (remove_pseudo_from_table): New function. (merge_equiv_classes): Use above function to remove pseudo-registers. (invalidate): Likewise. Added: branches/gcc-4_2-branch/gcc/testsuite/gcc.c-torture/compile/20080114-1.c Modified: branches/gcc-4_2-branch/gcc/ChangeLog branches/gcc-4_2-branch/gcc/cse.c branches/gcc-4_2-branch/gcc/testsuite/ChangeLog -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31944
[Bug rtl-optimization/31944] [4.1/4.2/4.3 Regression] Endless loop while building a 64-bit 2.6.20 kernel
--- Comment #32 from ebotcazou at gcc dot gnu dot org 2008-01-14 12:17 --- Subject: Bug 31944 Author: ebotcazou Date: Mon Jan 14 12:16:58 2008 New Revision: 131522 URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=131522 Log: PR rtl-optimization/31944 * cse.c (remove_pseudo_from_table): New function. (merge_equiv_classes): Use above function to remove pseudo-registers. (invalidate): Likewise. Added: trunk/gcc/testsuite/gcc.c-torture/compile/20080114-1.c Modified: trunk/gcc/ChangeLog trunk/gcc/cse.c trunk/gcc/testsuite/ChangeLog -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31944
[Bug rtl-optimization/31944] [4.1/4.2/4.3 Regression] Endless loop while building a 64-bit 2.6.20 kernel
--- Comment #29 from dave at hiauly1 dot hia dot nrc dot ca 2008-01-11 21:29 --- Subject: Re: [4.1/4.2/4.3 Regression] Endless loop while building a 64-bit 2.6.20 kernel Eric, More precisely the QTY is changed after the reg has been entered with a hash. This is expected, but the reg must be removed from the table. The problem here is that the reg is a pseudo and has been entered twice, for SImode and DImode, but is only removed once. Tentative fix to be attached. I believe that you have solved the problem. I did a quick cross build on hppa-unknown-linux-gnu with your change on the trunk and it fixed the endless loop. I'm now doing a regular bootstrap and check. Thanks, Dave -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31944
[Bug rtl-optimization/31944] [4.1/4.2/4.3 Regression] Endless loop while building a 64-bit 2.6.20 kernel
--- Comment #27 from ebotcazou at gcc dot gnu dot org 2008-01-11 18:09 --- Obviously, the problem is that the hash of reg 66 is changed after a hash table element is created for it in the bucket for the original hash. I have no idea yet whether this is expected, or if not, what is going wrong. More precisely the QTY is changed after the reg has been entered with a hash. This is expected, but the reg must be removed from the table. The problem here is that the reg is a pseudo and has been entered twice, for SImode and DImode, but is only removed once. Tentative fix to be attached. -- ebotcazou at gcc dot gnu dot org changed: What|Removed |Added CC||ebotcazou at gcc dot gnu dot ||org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31944
[Bug rtl-optimization/31944] [4.1/4.2/4.3 Regression] Endless loop while building a 64-bit 2.6.20 kernel
--- Comment #28 from ebotcazou at gcc dot gnu dot org 2008-01-11 18:09 --- Created an attachment (id=14927) -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=14927action=view) Lightly tested fix. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31944
[Bug rtl-optimization/31944] [4.1/4.2/4.3 Regression] Endless loop while building a 64-bit 2.6.20 kernel
--- Comment #31 from ebotcazou at gcc dot gnu dot org 2008-01-12 00:30 --- After playing with dbgcounts to see what happens, I indeed found the same as what Eric notes in comment #27. The proposed fix makes perfect sense. Thanks. Assigning to self. -- ebotcazou at gcc dot gnu dot org changed: What|Removed |Added AssignedTo|unassigned at gcc dot gnu |ebotcazou at gcc dot gnu dot |dot org |org Status|NEW |ASSIGNED Last reconfirmed|2008-01-09 19:09:59 |2008-01-12 00:30:41 date|| http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31944
[Bug rtl-optimization/31944] [4.1/4.2/4.3 Regression] Endless loop while building a 64-bit 2.6.20 kernel
--- Comment #30 from steven at gcc dot gnu dot org 2008-01-12 00:25 --- After playing with dbgcounts to see what happens, I indeed found the same as what Eric notes in comment #27. The proposed fix makes perfect sense. I won't be fixing this, I think Eric has already proposed the correct fix. -- steven at gcc dot gnu dot org changed: What|Removed |Added AssignedTo|steven at gcc dot gnu dot |unassigned at gcc dot gnu |org |dot org Status|ASSIGNED|NEW http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31944
[Bug rtl-optimization/31944] [4.1/4.2/4.3 Regression] Endless loop while building a 64-bit 2.6.20 kernel
--- Comment #22 from janis at gcc dot gnu dot org 2008-01-10 21:24 --- Steven asked for a regression hunt, but will not be pleased by the results. A hunt using a hppa64-linux cross cc1 on powerpc-linux identified http://gcc.gnu.org/viewcvs?view=revrev=81764 r81764 | dnovillo | 2004-05-13 06:41:07 + (Thu, 13 May 2004) which is the merge of tree-ssa-20020619-branch into mainline. If it would be helpful I could do a hunt on that branch. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31944
[Bug rtl-optimization/31944] [4.1/4.2/4.3 Regression] Endless loop while building a 64-bit 2.6.20 kernel
--- Comment #23 from steven at gcc dot gnu dot org 2008-01-10 22:18 --- Created an attachment (id=14916) -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=14916action=view) new test case that fails before the tree-ssa merge I made a new test case out of the .final_cleanup dump, and Janis confirmed it hangs even before the tree-ssa merge. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31944
[Bug rtl-optimization/31944] [4.1/4.2/4.3 Regression] Endless loop while building a 64-bit 2.6.20 kernel
--- Comment #24 from janis at gcc dot gnu dot org 2008-01-10 23:17 --- A regression test using the test added in comment #23 identified: http://gcc.gnu.org/viewcvs?view=revrev=74332 r74332 | sayle | 2003-12-05 14:06:46 + (Fri, 05 Dec 2003) -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31944
[Bug rtl-optimization/31944] [4.1/4.2/4.3 Regression] Endless loop while building a 64-bit 2.6.20 kernel
--- Comment #25 from steven at gcc dot gnu dot org 2008-01-10 23:44 --- So this has been failing since at least GCC 3.4. And I see nothing in the identified patch that is related to how CSE handles its values, so I suspect this bug exists in older compilers as well (just needs another test case, maybe). And I still have no idea what is really going wrong here... -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31944
[Bug rtl-optimization/31944] [4.1/4.2/4.3 Regression] Endless loop while building a 64-bit 2.6.20 kernel
--- Comment #26 from steven at gcc dot gnu dot org 2008-01-10 23:58 --- Mark, wrt. the release, I recommend this PR shouldn't be a blocker. The problem is old and is currently latent on the trunk, where it is only exposed with non-default options (-fno-inline-small-functions). Obviously, the problem is that the hash of reg 66 is changed after a hash table element is created for it in the bucket for the original hash. I have no idea yet whether this is expected, or if not, what is going wrong. Messing with CSE at this stage may be more dangerous than accepting the status quo. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31944
[Bug rtl-optimization/31944] [4.1/4.2/4.3 Regression] Endless loop while building a 64-bit 2.6.20 kernel
--- Comment #19 from rguenth at gcc dot gnu dot org 2008-01-09 15:36 --- (reg:DI 66 [ type.0+-4 ]) is entered twice in the table. During flushing we hit: Breakpoint 5, flush_hash_table () at /space/rguenther/src/svn/trunk/gcc/cse.c:1634 1634if (REG_P (p-exp)) (reg:DI 66 [ type.0+-4 ]) $14 = 1 $15 = (struct table_elt *) 0x1159440 ... Breakpoint 5, flush_hash_table () at /space/rguenther/src/svn/trunk/gcc/cse.c:1634 1634if (REG_P (p-exp)) (reg:DI 66 [ type.0+-4 ]) $32 = 5 $33 = (struct table_elt *) 0x11594a0 (gdb) print *p $34 = {exp = 0x2ac6c01389a0, canon_exp = 0x0, next_same_hash = 0x0, prev_same_hash = 0x0, next_same_value = 0x0, prev_same_value = 0x0, first_same_value = 0x11594a0, related_value = 0x0, cost = 0, regcost = 1, mode = SImode, in_memory = 0 '\0', is_const = 0 '\0', flag = -1 '#65533;'} and the hash of this reg is 29, not 5. But for the first entry we come along the hash is 1 and matches. So I suppose we have twice the same pseudo in the table, but as we only have one QTY per pseudo, the hash gets messed up. Indeed, the time we try to remove the second entry the QTY is actually invalid: $74 = {timestamp = 1, reg_qty = -67, reg_tick = 3, reg_in_table = -1, subreg_ticked = 4294967295} Reduced testcase: int type; void stuck(int res) { if (type == 1) { if (res == 0) asm volatile(nop); } else if (type == 0) { if (res == 0) asm volatile(nop : : i (0)); } } fails with -O2 on x86_64 - hppa64-linux cross. Steven - do you have an idea where to look further? Thx. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31944
[Bug rtl-optimization/31944] [4.1/4.2/4.3 Regression] Endless loop while building a 64-bit 2.6.20 kernel
--- Comment #20 from steven at gcc dot gnu dot org 2008-01-09 19:09 --- I still haven't been able to reproduce it with a cross and with the original test case. I'll try the reduced test case. Wish me luck. ;) -- steven at gcc dot gnu dot org changed: What|Removed |Added AssignedTo|unassigned at gcc dot gnu |steven at gcc dot gnu dot |dot org |org Status|NEW |ASSIGNED Last reconfirmed|2007-12-05 20:33:09 |2008-01-09 19:09:59 date|| http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31944
[Bug rtl-optimization/31944] [4.1/4.2/4.3 Regression] Endless loop while building a 64-bit 2.6.20 kernel
--- Comment #21 from steven at gcc dot gnu dot org 2008-01-09 22:46 --- at cse.c:5418: elt = insert (dest, sets[i].src_elt, sets[i].dest_hash, GET_MODE (dest)); dest = (reg:DI 66 [ type.0+-4 ]) sets[i].src_elt-exp = (sign_extend:DI (reg:SI 72 [ type ])) sets[i].dest_hash = 5 and REG_QTY(66) == 5 so everything is OK up to this point. Later on, REG_QTY(66) is changed. This means that the original hash of 5 also changes (the HASH of a reg is its QTY number plus a constant). -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31944
[Bug rtl-optimization/31944] [4.1/4.2/4.3 Regression] Endless loop while building a 64-bit 2.6.20 kernel
--- Comment #17 from steven at gcc dot gnu dot org 2008-01-08 16:14 --- Does anyone know how to reproduce this with a cross-compiler? -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31944
[Bug rtl-optimization/31944] [4.1/4.2/4.3 Regression] Endless loop while building a 64-bit 2.6.20 kernel
--- Comment #18 from rguenth at gcc dot gnu dot org 2008-01-08 16:29 --- The testcase reproduces for me on a x86_64 - hppa64-linux cross on trunk with -O2 -fno-inline-small-functions. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31944
[Bug rtl-optimization/31944] [4.1/4.2/4.3 Regression] Endless loop while building a 64-bit 2.6.20 kernel
--- Comment #16 from danglin at gcc dot gnu dot org 2008-01-01 21:26 --- It does. -- danglin at gcc dot gnu dot org changed: What|Removed |Added Summary|[4.1/4.2 Regression] Endless|[4.1/4.2/4.3 Regression] |loop while building a 64-bit|Endless loop while building |2.6.20 kernel |a 64-bit 2.6.20 kernel http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31944
[Bug rtl-optimization/31944] [4.1/4.2/4.3 Regression] Endless loop while building a 64-bit 2.6.20 kernel
-- pinskia at gcc dot gnu dot org changed: What|Removed |Added CC||pinskia at gcc dot gnu dot ||org Target Milestone|--- |4.1.3 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31944
[Bug rtl-optimization/31944] [4.1/4.2/4.3 Regression] Endless loop while building a 64-bit 2.6.20 kernel
--- Comment #9 from dave at hiauly1 dot hia dot nrc dot ca 2007-12-15 23:17 --- Subject: Re: [4.1/4.2/4.3 Regression] Endless loop while building a 64-bit 2.6.20 kernel What does the full cse1 dump look like at that point (don't forget to call fflush(dump_file) from gdb ;-) Is this reproducible with a cross-compiler? gdb has trouble doing fflush(dump_file) on hppa64-hp-hpux11.11 ;-( The problem seems to have gone away on the trunk. I've attached pr31944.c.111r.jump and pr31944.c.112r.cse1. The cse1 file has two dumps in it. The second was taken at the time of the hang. These are using the stage1 compiler for hppa64-hp-hpux11.11, version 4.2.3, revision 130785. Dave --- Comment #10 from dave at hiauly1 dot hia dot nrc dot ca 2007-12-15 23:17 --- Created an attachment (id=14770) -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=14770action=view) --- Comment #11 from dave at hiauly1 dot hia dot nrc dot ca 2007-12-15 23:17 --- Created an attachment (id=14771) -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=14771action=view) -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31944
[Bug rtl-optimization/31944] [4.1/4.2/4.3 Regression] Endless loop while building a 64-bit 2.6.20 kernel
-- danglin at gcc dot gnu dot org changed: What|Removed |Added Status|UNCONFIRMED |NEW Ever Confirmed|0 |1 Last reconfirmed|-00-00 00:00:00 |2007-12-05 20:33:09 date|| Summary|Endless loop while building |[4.1/4.2/4.3 Regression] |a 64-bit 2.6.20 kernel |Endless loop while building ||a 64-bit 2.6.20 kernel http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31944
[Bug rtl-optimization/31944] [4.1/4.2/4.3 Regression] Endless loop while building a 64-bit 2.6.20 kernel
--- Comment #8 from steven at gcc dot gnu dot org 2007-12-05 22:29 --- What does the full cse1 dump look like at that point (don't forget to call fflush(dump_file) from gdb ;-) Is this reproducible with a cross-compiler? -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31944
[Bug rtl-optimization/31944] [4.1/4.2/4.3 Regression] Endless loop while building a 64-bit 2.6.20 kernel
--- Comment #7 from rguenth at gcc dot gnu dot org 2007-12-05 21:51 --- Let's ask the Steven-o-racle ;) -- rguenth at gcc dot gnu dot org changed: What|Removed |Added CC||steven at gcc dot gnu dot ||org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31944