aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2022-05-12 14:03:32 +0200
committerRichard Biener <rguenther@suse.de>2022-05-12 15:05:45 +0200
commitdfda40f8147412328f699628a54b0aaa584776e7 (patch)
tree237be28ae200f54b39c441b74a6495d8dad3c9cb
parentc4471a4a3cd0923582f88249feb9fb1a2e37c32a (diff)
downloadgcc-dfda40f8147412328f699628a54b0aaa584776e7.zip
gcc-dfda40f8147412328f699628a54b0aaa584776e7.tar.gz
gcc-dfda40f8147412328f699628a54b0aaa584776e7.tar.bz2
rtl-optimization/105577 - RTL DSE and non-call EH
When one of the first two stages of DSE removes a throwing stmt we have to purge dead EH edges before the DF re-analyze fires off a fast DCE since that cannot cope with the situation. 2022-05-12 Richard Biener <rguenther@suse.de> PR rtl-optimization/105577 * dse.cc (rest_of_handle_dse): Make sure to purge dead EH edges before running fast DCE via df_analyze.
-rw-r--r--gcc/dse.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/gcc/dse.cc b/gcc/dse.cc
index a58c17e..30c11ce 100644
--- a/gcc/dse.cc
+++ b/gcc/dse.cc
@@ -3682,6 +3682,16 @@ rest_of_handle_dse (void)
dse_step0 ();
dse_step1 ();
+ /* DSE can eliminate potentially-trapping MEMs.
+ Remove any EH edges associated with them, since otherwise
+ DF_LR_RUN_DCE will complain later. */
+ if ((locally_deleted || globally_deleted)
+ && cfun->can_throw_non_call_exceptions
+ && purge_all_dead_edges ())
+ {
+ free_dominance_info (CDI_DOMINATORS);
+ delete_unreachable_blocks ();
+ }
dse_step2_init ();
if (dse_step2 ())
{