re PR tree-optimization/57122 (ICE in verify_loop_structure, at cfgloop.c:1647 (loop n’s latch does not have an edge to its header !))
2013-04-30 Richard Biener <rguenther@suse.de> PR middle-end/57122 * cfghooks.c (split_edge): Properly check for the loop latch edge. * gcc.dg/torture/pr57122.c: New testcase. From-SVN: r198456
This commit is contained in:
parent
4c1aff1ce4
commit
3551257c5d
4 changed files with 41 additions and 1 deletions
|
@ -1,3 +1,9 @@
|
|||
2013-04-30 Richard Biener <rguenther@suse.de>
|
||||
|
||||
PR middle-end/57122
|
||||
* cfghooks.c (split_edge): Properly check for the loop
|
||||
latch edge.
|
||||
|
||||
2013-04-30 Richard Biener <rguenther@suse.de>
|
||||
|
||||
PR middle-end/57107
|
||||
|
|
|
@ -662,7 +662,9 @@ split_edge (edge e)
|
|||
loop = find_common_loop (src->loop_father, dest->loop_father);
|
||||
add_bb_to_loop (ret, loop);
|
||||
|
||||
if (loop->latch == src)
|
||||
/* If we split the latch edge of loop adjust the latch block. */
|
||||
if (loop->latch == src
|
||||
&& loop->header == dest)
|
||||
loop->latch = ret;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
2013-04-30 Richard Biener <rguenther@suse.de>
|
||||
|
||||
PR middle-end/57122
|
||||
* gcc.dg/torture/pr57122.c: New testcase.
|
||||
|
||||
2013-04-30 Richard Biener <rguenther@suse.de>
|
||||
|
||||
PR middle-end/57107
|
||||
|
|
27
gcc/testsuite/gcc.dg/torture/pr57122.c
Normal file
27
gcc/testsuite/gcc.dg/torture/pr57122.c
Normal file
|
@ -0,0 +1,27 @@
|
|||
/* { dg-do compile } */
|
||||
|
||||
unsigned a;
|
||||
int b, c;
|
||||
|
||||
void f(void)
|
||||
{
|
||||
if(a)
|
||||
{
|
||||
for(a = 0; a < 2; a++)
|
||||
a /= 7;
|
||||
|
||||
for(;; a++)
|
||||
{
|
||||
if(a)
|
||||
lbl1:
|
||||
b++;
|
||||
|
||||
if(c)
|
||||
goto lbl1;
|
||||
lbl2:
|
||||
;
|
||||
}
|
||||
}
|
||||
|
||||
goto lbl2;
|
||||
}
|
Loading…
Add table
Reference in a new issue