* [Bug rtl-optimization/51069] [4.7 Regression] ICE in verify_loop_structure, at cfgloop.c:1559
2011-11-09 20:59 [Bug c/51069] New: ICE in verify_loop_structure, at cfgloop.c:1559 regehr at cs dot utah.edu
@ 2011-11-10 11:18 ` rguenth at gcc dot gnu.org
2011-12-05 9:48 ` jakub at gcc dot gnu.org
` (7 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-11-10 11:18 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51069
Richard Guenther <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target| |x86_64-*-*
Status|UNCONFIRMED |NEW
Last reconfirmed| |2011-11-10
Component|c |rtl-optimization
Known to work| |4.6.2
Target Milestone|--- |4.7.0
Summary|ICE in |[4.7 Regression] ICE in
|verify_loop_structure, at |verify_loop_structure, at
|cfgloop.c:1559 |cfgloop.c:1559
Ever Confirmed|0 |1
--- Comment #1 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-11-10 11:10:27 UTC ---
Confirmed. Caused by RTL unrolling.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug rtl-optimization/51069] [4.7 Regression] ICE in verify_loop_structure, at cfgloop.c:1559
2011-11-09 20:59 [Bug c/51069] New: ICE in verify_loop_structure, at cfgloop.c:1559 regehr at cs dot utah.edu
2011-11-10 11:18 ` [Bug rtl-optimization/51069] [4.7 Regression] " rguenth at gcc dot gnu.org
@ 2011-12-05 9:48 ` jakub at gcc dot gnu.org
2011-12-05 12:46 ` jakub at gcc dot gnu.org
` (6 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2011-12-05 9:48 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51069
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jakub at gcc dot gnu.org
--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-12-05 09:47:33 UTC ---
Started with http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=171946
Tiny bit reduced testcase for -O3 -funroll-loops:
int a, b, c, d, e, f, bar (void);
void
foo (int x)
{
for (;;)
{
if (!x)
{
for (d = 6; d >= 0; d--)
{
while (!b)
;
if (e)
return foo (x);
if (f)
{
a = 0;
continue;
}
for (; c; c--)
;
}
}
if (bar ())
break;
e = 0;
if (x)
for (;;)
;
}
}
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug rtl-optimization/51069] [4.7 Regression] ICE in verify_loop_structure, at cfgloop.c:1559
2011-11-09 20:59 [Bug c/51069] New: ICE in verify_loop_structure, at cfgloop.c:1559 regehr at cs dot utah.edu
2011-11-10 11:18 ` [Bug rtl-optimization/51069] [4.7 Regression] " rguenth at gcc dot gnu.org
2011-12-05 9:48 ` jakub at gcc dot gnu.org
@ 2011-12-05 12:46 ` jakub at gcc dot gnu.org
2011-12-06 13:56 ` rguenth at gcc dot gnu.org
` (5 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2011-12-05 12:46 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51069
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |hubicka at gcc dot gnu.org
--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-12-05 12:46:05 UTC ---
CCing Honza, not familiar enough with remove_path/unroll.
#0 unloop (loop=0x7ffff133d880, irred_invalidated=0x7fffffffdeef "") at
../../gcc/cfgloopmanip.c:797
#1 0x0000000000675e53 in remove_path (e=0x7ffff146c900) at
../../gcc/cfgloopmanip.c:319
#2 0x00000000009ae07f in peel_loop_completely (loop=0x7ffff133d880) at
../../gcc/loop-unroll.c:514
#3 0x00000000009ad89f in peel_loops_completely (flags=2) at
../../gcc/loop-unroll.c:256
#4 0x00000000009ad640 in unroll_and_peel_loops (flags=2) at
../../gcc/loop-unroll.c:165
#5 0x00000000009a07e4 in rtl_unroll_and_peel_loops () at
../../gcc/loop-init.c:329
is called with
loop_2 (header = 6, latch = 21, niter = )
{
bb_6 (preds = {bb_21 bb_45 }, succs = {bb_9 bb_7 })
bb_9 (preds = {bb_6 }, succs = {bb_10 bb_11 })
bb_11 (preds = {bb_9 }, succs = {bb_21 bb_12 })
bb_21 (preds = {bb_11 }, succs = {bb_6 })
}
where bb_4, bb_12, bb_13 and bb_14 are BB_IRREDUCIBLE_LOOP, before this unroll
call verify_loop_structure passes, after it already fails. Of course calling
mark_irreducible_loops () after peel_loops_completely () fixes this up and let
the testcase pass, but remove_path/unroll should figure it out if it
invalidates this property.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug rtl-optimization/51069] [4.7 Regression] ICE in verify_loop_structure, at cfgloop.c:1559
2011-11-09 20:59 [Bug c/51069] New: ICE in verify_loop_structure, at cfgloop.c:1559 regehr at cs dot utah.edu
` (2 preceding siblings ...)
2011-12-05 12:46 ` jakub at gcc dot gnu.org
@ 2011-12-06 13:56 ` rguenth at gcc dot gnu.org
2011-12-23 21:47 ` hubicka at gcc dot gnu.org
` (4 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-12-06 13:56 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51069
Richard Guenther <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |ice-checking
Priority|P3 |P1
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug rtl-optimization/51069] [4.7 Regression] ICE in verify_loop_structure, at cfgloop.c:1559
2011-11-09 20:59 [Bug c/51069] New: ICE in verify_loop_structure, at cfgloop.c:1559 regehr at cs dot utah.edu
` (3 preceding siblings ...)
2011-12-06 13:56 ` rguenth at gcc dot gnu.org
@ 2011-12-23 21:47 ` hubicka at gcc dot gnu.org
2011-12-27 18:50 ` hubicka at gcc dot gnu.org
` (3 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: hubicka at gcc dot gnu.org @ 2011-12-23 21:47 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51069
Jan Hubicka <hubicka at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |rakdver at gcc dot gnu.org
--- Comment #4 from Jan Hubicka <hubicka at gcc dot gnu.org> 2011-12-23 19:15:21 UTC ---
I am not terribly familiar with the logic here either, Zdenek?
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug rtl-optimization/51069] [4.7 Regression] ICE in verify_loop_structure, at cfgloop.c:1559
2011-11-09 20:59 [Bug c/51069] New: ICE in verify_loop_structure, at cfgloop.c:1559 regehr at cs dot utah.edu
` (4 preceding siblings ...)
2011-12-23 21:47 ` hubicka at gcc dot gnu.org
@ 2011-12-27 18:50 ` hubicka at gcc dot gnu.org
2011-12-27 19:05 ` hubicka at gcc dot gnu.org
` (2 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: hubicka at gcc dot gnu.org @ 2011-12-27 18:50 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51069
--- Comment #5 from Jan Hubicka <hubicka at gcc dot gnu.org> 2011-12-27 18:32:05 UTC ---
note that remove_path may affect presence of irreducible loops and it already
has logic to update the flags. It seems to be case that gets missed. I am
trying to make sense of it now.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug rtl-optimization/51069] [4.7 Regression] ICE in verify_loop_structure, at cfgloop.c:1559
2011-11-09 20:59 [Bug c/51069] New: ICE in verify_loop_structure, at cfgloop.c:1559 regehr at cs dot utah.edu
` (5 preceding siblings ...)
2011-12-27 18:50 ` hubicka at gcc dot gnu.org
@ 2011-12-27 19:05 ` hubicka at gcc dot gnu.org
2012-01-01 12:08 ` hubicka at gcc dot gnu.org
2012-01-01 15:03 ` hubicka at gcc dot gnu.org
8 siblings, 0 replies; 10+ messages in thread
From: hubicka at gcc dot gnu.org @ 2011-12-27 19:05 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51069
--- Comment #6 from Jan Hubicka <hubicka at gcc dot gnu.org> 2011-12-27 18:50:14 UTC ---
OK,
the problem is that by removing conditional entrance into irreducible region,
the BB becomes part of the region itself.
I am testing the following patch
Index: cfgloopmanip.c
===================================================================
--- cfgloopmanip.c (revision 182692)
+++ cfgloopmanip.c (working copy)
@@ -290,6 +290,7 @@ remove_path (edge e)
int i, nrem, n_bord_bbs;
sbitmap seen;
bool irred_invalidated = false;
+ edge_iterator ei;
if (!can_remove_branch_p (e))
return false;
@@ -329,9 +330,12 @@ remove_path (edge e)
/* Find "border" hexes -- i.e. those with predecessor in removed path. */
for (i = 0; i < nrem; i++)
SET_BIT (seen, rem_bbs[i]->index);
+ FOR_EACH_EDGE (ae, ei, e->src->succs)
+ if (ae != e && ae->dest != EXIT_BLOCK_PTR && !TEST_BIT (seen,
ae->dest->index)
+ && ae->flags & EDGE_IRREDUCIBLE_LOOP)
+ irred_invalidated = true;
for (i = 0; i < nrem; i++)
{
- edge_iterator ei;
bb = rem_bbs[i];
FOR_EACH_EDGE (ae, ei, rem_bbs[i]->succs)
if (ae->dest != EXIT_BLOCK_PTR && !TEST_BIT (seen, ae->dest->index))
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug rtl-optimization/51069] [4.7 Regression] ICE in verify_loop_structure, at cfgloop.c:1559
2011-11-09 20:59 [Bug c/51069] New: ICE in verify_loop_structure, at cfgloop.c:1559 regehr at cs dot utah.edu
` (6 preceding siblings ...)
2011-12-27 19:05 ` hubicka at gcc dot gnu.org
@ 2012-01-01 12:08 ` hubicka at gcc dot gnu.org
2012-01-01 15:03 ` hubicka at gcc dot gnu.org
8 siblings, 0 replies; 10+ messages in thread
From: hubicka at gcc dot gnu.org @ 2012-01-01 12:08 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51069
--- Comment #7 from Jan Hubicka <hubicka at gcc dot gnu.org> 2012-01-01 12:07:42 UTC ---
Author: hubicka
Date: Sun Jan 1 12:07:34 2012
New Revision: 182767
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=182767
Log:
PR rtl-optimization/51069
* cfgloopmanip.c (remove_path): Removing path making irreducible
region unconditional makes BB part of the region.
* gcc.c-torture/compile/pr51069.c: New testcase.
Added:
trunk/gcc/testsuite/gcc.c-torture/compile/pr51069.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/cfgloopmanip.c
trunk/gcc/testsuite/ChangeLog
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug rtl-optimization/51069] [4.7 Regression] ICE in verify_loop_structure, at cfgloop.c:1559
2011-11-09 20:59 [Bug c/51069] New: ICE in verify_loop_structure, at cfgloop.c:1559 regehr at cs dot utah.edu
` (7 preceding siblings ...)
2012-01-01 12:08 ` hubicka at gcc dot gnu.org
@ 2012-01-01 15:03 ` hubicka at gcc dot gnu.org
8 siblings, 0 replies; 10+ messages in thread
From: hubicka at gcc dot gnu.org @ 2012-01-01 15:03 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51069
Jan Hubicka <hubicka at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
--- Comment #8 from Jan Hubicka <hubicka at gcc dot gnu.org> 2012-01-01 15:01:57 UTC ---
Fixed.
^ permalink raw reply [flat|nested] 10+ messages in thread