From 6c5ed3f18ce31e71dc1089e8298c70fd2a0a08c2 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Wed, 21 Jan 2015 22:51:43 +0100 Subject: 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 --- gcc/dse.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'gcc/dse.c') 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; } -- cgit v1.1