mirrored from git://gcc.gnu.org/git/gcc.git
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tree-optimization/114787 - more careful loop update with CFG cleanup
When CFG cleanup removes a backedge we have to be more careful with loop update. In particular we need to clear niter info and estimates and if we remove the last backedge of a loop we have to also mark it for removal to prevent a following basic block merging to associate loop info with an unrelated header. PR tree-optimization/114787 * tree-cfg.cc (remove_edge_and_dominated_blocks): When removing a loop backedge clear niter info and when removing the last backedge of a loop mark that loop for removal. * gcc.dg/torture/pr114787.c: New testcase.
- Loading branch information
Showing
2 changed files
with
50 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* { dg-do run } */ | ||
|
||
int a, b, c, d, e = -1, f, g, h, j, k, n, o, p; | ||
int main() { | ||
int i, l = 2, m; | ||
for (b = 0; b < 1; b++) | ||
l = 0; | ||
for (; a >= 0; a--) | ||
for (m = 3; m; m--) { | ||
k = g; | ||
i = 0; | ||
for (; i < 1; i++) | ||
for (; f < 1; f++) | ||
h = g; | ||
n = 2 & ((e ^ d) | 1) * j; | ||
o = ~(e & n); | ||
q: | ||
if (c <= e) | ||
return 0; | ||
e = o; | ||
} | ||
p = l; | ||
l = 0; | ||
if (p) | ||
goto q; | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters