aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2015-01-21 22:51:43 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2015-01-21 22:51:43 +0100
commit6c5ed3f18ce31e71dc1089e8298c70fd2a0a08c2 (patch)
tree12c988528c2bd3478ee358c3b7dbeff55a67e4da /gcc
parent31be63ab8c4def775c9ece0b6fa8d0fedc11bae4 (diff)
downloadgcc-6c5ed3f18ce31e71dc1089e8298c70fd2a0a08c2.zip
gcc-6c5ed3f18ce31e71dc1089e8298c70fd2a0a08c2.tar.gz
gcc-6c5ed3f18ce31e71dc1089e8298c70fd2a0a08c2.tar.bz2
re PR rtl-optimization/62078 (ICE: verify_flow_info failed: missing REG_EH_REGION note at the end of bb 2 with -fdelete-dead-exceptions)
PR rtl-optimization/62078 * dse.c: Include cfgcleanup.h. (rest_of_handle_dse): For -fnon-call-exceptions, if DSE removed anything call purge_all_dead_edges and cleanup_cfg at the end of the pass. * g++.dg/opt/pr62078.C: New test. From-SVN: r219970
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog8
-rw-r--r--gcc/dse.c9
-rw-r--r--gcc/testsuite/ChangeLog3
-rw-r--r--gcc/testsuite/g++.dg/opt/pr62078.C36
4 files changed, 56 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 4f3cc89..af86a4d 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,11 @@
+2015-01-21 Jakub Jelinek <jakub@redhat.com>
+
+ PR rtl-optimization/62078
+ * dse.c: Include cfgcleanup.h.
+ (rest_of_handle_dse): For -fnon-call-exceptions, if DSE removed
+ anything call purge_all_dead_edges and cleanup_cfg at the end
+ of the pass.
+
2015-01-21 Jan Hubicka <hubicka@ucw.cz>
* ipa-utils.c (ipa_merge_profiles): Avoid ICE on mismatch in indirect
diff --git a/gcc/dse.c b/gcc/dse.c
index a7d46b8..ea6f245 100644
--- a/gcc/dse.c
+++ b/gcc/dse.c
@@ -81,6 +81,7 @@ along with GCC; see the file COPYING3. If not see
#include "gimple.h"
#include "gimple-ssa.h"
#include "rtl-iter.h"
+#include "cfgcleanup.h"
/* This file contains three techniques for performing Dead Store
Elimination (dse).
@@ -3746,6 +3747,14 @@ rest_of_handle_dse (void)
if (dump_file)
fprintf (dump_file, "dse: local deletions = %d, global deletions = %d, spill deletions = %d\n",
locally_deleted, globally_deleted, spill_deleted);
+
+ /* DSE can eliminate potentially-trapping MEMs.
+ Remove any EH edges associated with them. */
+ if ((locally_deleted || globally_deleted)
+ && cfun->can_throw_non_call_exceptions
+ && purge_all_dead_edges ())
+ cleanup_cfg (0);
+
return 0;
}
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 784ce46..057f0ca 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,5 +1,8 @@
2015-01-21 Jakub Jelinek <jakub@redhat.com>
+ PR rtl-optimization/62078
+ * g++.dg/opt/pr62078.C: New test.
+
PR c/63307
* c-c++-common/cilk-plus/CK/pr63307.c: New test.
diff --git a/gcc/testsuite/g++.dg/opt/pr62078.C b/gcc/testsuite/g++.dg/opt/pr62078.C
new file mode 100644
index 0000000..8730432
--- /dev/null
+++ b/gcc/testsuite/g++.dg/opt/pr62078.C
@@ -0,0 +1,36 @@
+/* PR rtl-optimization/62078 */
+/* { dg-do compile } */
+/* { dg-options "-Og -fdelete-dead-exceptions -fnon-call-exceptions" } */
+
+struct A { virtual ~A (); };
+struct B : A {};
+struct C : B {};
+struct D : C {};
+struct E : D {};
+struct F : E {};
+struct G : F {};
+struct H : G {};
+struct I : H {};
+struct J : I {};
+struct K : J {};
+struct L : K {};
+struct M : L {};
+struct N : M {};
+struct O : N {};
+struct P : O {};
+struct Q : P {};
+struct R : Q {};
+struct S : R {};
+struct T : S {};
+struct U : T {};
+struct V : U {};
+struct W : V {};
+struct X : W {};
+struct Y : X {};
+struct Z : Y {};
+
+void
+foo ()
+{
+ Z z;
+}