aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorIlya Leoshkevich <iii@linux.ibm.com>2019-11-12 14:24:35 +0000
committerIlya Leoshkevich <iii@gcc.gnu.org>2019-11-12 14:24:35 +0000
commite2d3e85c877af1cdade1dbbb95955c31932caa87 (patch)
tree1f76b96a09d6c95ae8895c0b4d7a30b5f4d29a43 /gcc
parent41098a37444b69d7b3b3072fde52e2785bef7012 (diff)
downloadgcc-e2d3e85c877af1cdade1dbbb95955c31932caa87.zip
gcc-e2d3e85c877af1cdade1dbbb95955c31932caa87.tar.gz
gcc-e2d3e85c877af1cdade1dbbb95955c31932caa87.tar.bz2
Free dominance info at the beginning of pass_jump_after_combine
try_forward_edges does not update dominance info, and merge_blocks relies on it being up-to-date. In PR92430 stale dominance info makes merge_blocks produce a loop in the dominator tree, which in turn makes delete_basic_block loop forever. Fix by freeing dominance info at the beginning of cleanup_cfg. gcc/ChangeLog: 2019-11-12 Ilya Leoshkevich <iii@linux.ibm.com> PR rtl-optimization/92430 * cfgcleanup.c (pass_jump_after_combine::execute): Free dominance info at the beginning. gcc/testsuite/ChangeLog: 2019-11-12 Ilya Leoshkevich <iii@linux.ibm.com> PR rtl-optimization/92430 * gcc.dg/pr92430.c: New test (from Arseny Solokha). From-SVN: r278095
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/cfgcleanup.c2
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.dg/pr92430.c25
4 files changed, 38 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 29641f0..7f5c002 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2019-11-12 Ilya Leoshkevich <iii@linux.ibm.com>
+
+ PR rtl-optimization/92430
+ * cfgcleanup.c (pass_jump_after_combine::execute): Free
+ dominance info at the beginning.
+
2019-11-12 Richard Biener <rguenther@suse.de>
PR tree-optimization/92460
diff --git a/gcc/cfgcleanup.c b/gcc/cfgcleanup.c
index 6539d93..7f38825 100644
--- a/gcc/cfgcleanup.c
+++ b/gcc/cfgcleanup.c
@@ -3311,6 +3311,8 @@ public:
unsigned int
pass_jump_after_combine::execute (function *)
{
+ /* Jump threading does not keep dominators up-to-date. */
+ free_dominance_info (CDI_DOMINATORS);
cleanup_cfg (flag_thread_jumps ? CLEANUP_THREADING : 0);
return 0;
}
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 3fa8d21..f9d59b0 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2019-11-12 Ilya Leoshkevich <iii@linux.ibm.com>
+
+ PR rtl-optimization/92430
+ * gcc.dg/pr92430.c: New test (from Arseny Solokha).
+
2019-11-12 Richard Biener <rguenther@suse.de>
PR tree-optimization/92461
diff --git a/gcc/testsuite/gcc.dg/pr92430.c b/gcc/testsuite/gcc.dg/pr92430.c
new file mode 100644
index 0000000..9156068
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr92430.c
@@ -0,0 +1,25 @@
+// PR rtl-optimization/92430
+// { dg-do compile }
+// { dg-options "-Os -fno-if-conversion -fno-tree-dce -fno-tree-loop-optimize -fno-tree-vrp" }
+
+int eb, ko;
+
+void
+e9 (int pe, int lx)
+{
+ int ir;
+
+ for (ir = 0; ir < 1; ++ir)
+ {
+ for (ko = 0; ko < 1; ++ko)
+ {
+ for (eb = 0; eb < 1; ++eb)
+ ko += pe;
+
+ for (ko = 0; ko < 1; ++ko)
+ ;
+ }
+
+ pe = ir = lx;
+ }
+}