From: Richard Biener Date: Thu, 12 May 2022 12:03:32 +0000 (+0200) Subject: rtl-optimization/105577 - RTL DSE and non-call EH X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b251f8be6b018966edad5daeb45c42fd193b24b4;p=test_jj.git 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 PR rtl-optimization/105577 * dse.cc (rest_of_handle_dse): Make sure to purge dead EH edges before running fast DCE via df_analyze. (cherry picked from commit dfda40f8147412328f699628a54b0aaa584776e7) --- diff --git a/gcc/dse.cc b/gcc/dse.cc index b8914a3..bb658a8 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 ()) {