Commit 715a1df
committed
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.
(cherry picked from commit cc48418)1 parent 4c3011e commit 715a1df
2 files changed
+50
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8872 | 8872 | | |
8873 | 8873 | | |
8874 | 8874 | | |
| 8875 | + | |
8875 | 8876 | | |
8876 | | - | |
8877 | | - | |
8878 | | - | |
| 8877 | + | |
| 8878 | + | |
| 8879 | + | |
| 8880 | + | |
| 8881 | + | |
| 8882 | + | |
| 8883 | + | |
| 8884 | + | |
| 8885 | + | |
| 8886 | + | |
| 8887 | + | |
| 8888 | + | |
| 8889 | + | |
| 8890 | + | |
| 8891 | + | |
| 8892 | + | |
| 8893 | + | |
| 8894 | + | |
| 8895 | + | |
| 8896 | + | |
| 8897 | + | |
| 8898 | + | |
8879 | 8899 | | |
8880 | 8900 | | |
8881 | 8901 | | |
| |||
0 commit comments