aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2019-11-23 11:05:31 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2019-11-23 11:05:31 +0100
commitba585b91532b5cb382f1e2d21be50e728bca1da0 (patch)
tree6f7a47c199276ff4edb1b2d1d49f104db70e995a
parent41149acaff5ccb046ebf8ac7ae6eadb147f6f6b8 (diff)
downloadgcc-ba585b91532b5cb382f1e2d21be50e728bca1da0.zip
gcc-ba585b91532b5cb382f1e2d21be50e728bca1da0.tar.gz
gcc-ba585b91532b5cb382f1e2d21be50e728bca1da0.tar.bz2
re PR rtl-optimization/92610 (ICE in calc_dfs_tree, at dominance.c:458 since r270940)
PR rtl-optimization/92610 * cse.c (rest_of_handle_cse2): Call cleanup_cfg (0) also if cse_cfg_altered is set, even when tem is 0. (rest_of_handle_cse_after_global_opts): Likewise. * g++.dg/opt/pr92610.C: New test. From-SVN: r278640
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/cse.c4
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/g++.dg/opt/pr92610.C13
4 files changed, 27 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 6ed7aba..596db03 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+2019-11-23 Jakub Jelinek <jakub@redhat.com>
+
+ PR rtl-optimization/92610
+ * cse.c (rest_of_handle_cse2): Call cleanup_cfg (0) also if
+ cse_cfg_altered is set, even when tem is 0.
+ (rest_of_handle_cse_after_global_opts): Likewise.
+
2019-11-22 Jakub Jelinek <jakub@redhat.com>
PR c++/92458
diff --git a/gcc/cse.c b/gcc/cse.c
index ab9b8b4..dd4c42d 100644
--- a/gcc/cse.c
+++ b/gcc/cse.c
@@ -7701,7 +7701,7 @@ rest_of_handle_cse2 (void)
cse_cfg_altered |= cleanup_cfg (CLEANUP_CFG_CHANGED);
timevar_pop (TV_JUMP);
}
- else if (tem == 1)
+ else if (tem == 1 || cse_cfg_altered)
cse_cfg_altered |= cleanup_cfg (0);
cse_not_expected = 1;
@@ -7775,7 +7775,7 @@ rest_of_handle_cse_after_global_opts (void)
cse_cfg_altered |= cleanup_cfg (CLEANUP_CFG_CHANGED);
timevar_pop (TV_JUMP);
}
- else if (tem == 1)
+ else if (tem == 1 || cse_cfg_altered)
cse_cfg_altered |= cleanup_cfg (0);
flag_cse_follow_jumps = save_cfj;
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index c34573b..1c8f1a0 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2019-11-23 Jakub Jelinek <jakub@redhat.com>
+
+ PR rtl-optimization/92610
+ * g++.dg/opt/pr92610.C: New test.
+
2019-11-23 Bernd Edlinger <bernd.edlinger@hotmail.de>
PR c++/92365
diff --git a/gcc/testsuite/g++.dg/opt/pr92610.C b/gcc/testsuite/g++.dg/opt/pr92610.C
new file mode 100644
index 0000000..bead760
--- /dev/null
+++ b/gcc/testsuite/g++.dg/opt/pr92610.C
@@ -0,0 +1,13 @@
+// PR rtl-optimization/92610
+// { dg-do compile }
+// { dg-options "-w -fdelete-dead-exceptions --param=sccvn-max-alias-queries-per-access=0 -fno-dse -fnon-call-exceptions -Os -funroll-loops -ftrapv" }
+
+struct C { int x; ~C () {} };
+
+int
+main ()
+{
+ C *buffer = new C[42];
+ buffer[-3].x = 42;
+ delete [] buffer;
+}