Skip to content

Commit

Permalink
fix pr78384
Browse files Browse the repository at this point in the history
	PR tree-optimization/78384
	* tree-ssa-loop-split.c (patch_loop_exit): Use correct edge.

testsuite/
	PR tree-optimization/78384
	* gcc.dg/pr78384.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@244811 138bc75d-0d04-0410-961f-82ee72b054a4
  • Loading branch information
matz committed Jan 23, 2017
1 parent 4109e2c commit 7c9b5ff
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 1 deletion.
5 changes: 5 additions & 0 deletions gcc/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
2017-01-23 Michael Matz <[email protected]>

PR tree-optimization/78384
* tree-ssa-loop-split.c (patch_loop_exit): Use correct edge.

2017-01-23 Richard Biener <[email protected]>

PR tree-optimization/79186
Expand Down
5 changes: 5 additions & 0 deletions gcc/testsuite/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
2017-01-23 Michael Matz <[email protected]>

PR tree-optimization/78384
* gcc.dg/pr78384.c: New test.

2017-01-23 Richard Biener <[email protected]>

PR tree-optimization/79186
Expand Down
25 changes: 25 additions & 0 deletions gcc/testsuite/gcc.dg/pr78384.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/* PR tree-optimization/78384
{ dg-do compile }
{ dg-options "-O3 -w -fsplit-loops" } */
void
a2 (int wv, int yg, int r9)
{
while (wv < 1)
{
int vn = r9 % 0;

while (yg < 1)
{
int lz;

for (r9 = 0; r9 < 17; ++r9)
{
}

it:
lz = (yg++ >= 0) ? 2 : 0;
wv = vn < lz;
}
}
goto it;
}
2 changes: 1 addition & 1 deletion gcc/tree-ssa-loop-split.c
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ patch_loop_exit (struct loop *loop, gcond *guard, tree nextval, tree newbound,
nextval, newbound);
update_stmt (stmt);

edge stay = single_pred_edge (loop->latch);
edge stay = EDGE_SUCC (exit->src, EDGE_SUCC (exit->src, 0) == exit);

exit->flags &= ~(EDGE_TRUE_VALUE | EDGE_FALSE_VALUE);
stay->flags &= ~(EDGE_TRUE_VALUE | EDGE_FALSE_VALUE);
Expand Down

0 comments on commit 7c9b5ff

Please sign in to comment.