From af1634f1b555004753a22d1124dbb8419ee095cb Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Fri, 8 May 2020 09:30:54 +0200 Subject: [PATCH] csa: Fix --enable-checking=yes,df bootstrap failure in csa [PR94961] My recent combine-stack-adj.c change broke df checking bootstrap, while most of the changes are done through validate_change/confirm_changes which update df info, the removal of REG_EQUAL notes didn't update df info. 2020-05-08 Jakub Jelinek PR bootstrap/94961 PR rtl-optimization/94516 * rtl.h (remove_reg_equal_equiv_notes): Add a bool argument defaulted to false. * rtlanal.c (remove_reg_equal_equiv_notes): Add no_rescan argument. Call df_notes_rescan if that argument is not true and returning true. * combine.c (adjust_for_new_dest): Pass true as second argument to remove_reg_equal_equiv_notes. * postreload.c (reload_combine_recognize_pattern): Don't call df_notes_rescan. --- gcc/ChangeLog | 13 +++++++++++++ gcc/combine.c | 2 +- gcc/postreload.c | 9 ++++----- gcc/rtl.h | 2 +- gcc/rtlanal.c | 7 +++++-- 5 files changed, 24 insertions(+), 9 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 36226e00fc0..27f6ea4f97f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,16 @@ +2020-05-08 Jakub Jelinek + + PR bootstrap/94961 + PR rtl-optimization/94516 + * rtl.h (remove_reg_equal_equiv_notes): Add a bool argument defaulted + to false. + * rtlanal.c (remove_reg_equal_equiv_notes): Add no_rescan argument. + Call df_notes_rescan if that argument is not true and returning true. + * combine.c (adjust_for_new_dest): Pass true as second argument to + remove_reg_equal_equiv_notes. + * postreload.c (reload_combine_recognize_pattern): Don't call + df_notes_rescan. + 2020-05-07 Segher Boessenkool * config/rs6000/rs6000.md (*setnbc_signed_): New diff --git a/gcc/combine.c b/gcc/combine.c index f69413a34d0..b044f29fd36 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -2459,7 +2459,7 @@ static void adjust_for_new_dest (rtx_insn *insn) { /* For notes, be conservative and simply remove them. */ - remove_reg_equal_equiv_notes (insn); + remove_reg_equal_equiv_notes (insn, true); /* The new insn will have a destination that was previously the destination of an insn just above it. Call distribute_links to make a LOG_LINK from diff --git a/gcc/postreload.c b/gcc/postreload.c index 677b8244e3e..f6258285022 100644 --- a/gcc/postreload.c +++ b/gcc/postreload.c @@ -1223,11 +1223,10 @@ reload_combine_recognize_pattern (rtx_insn *insn) /* Delete the reg-reg addition. */ delete_insn (insn); - if (reg_state[regno].offset != const0_rtx - /* Previous REG_EQUIV / REG_EQUAL notes for PREV - are now invalid. */ - && remove_reg_equal_equiv_notes (prev)) - df_notes_rescan (prev); + if (reg_state[regno].offset != const0_rtx) + /* Previous REG_EQUIV / REG_EQUAL notes for PREV + are now invalid. */ + remove_reg_equal_equiv_notes (prev); reg_state[regno].use_index = RELOAD_COMBINE_MAX_USES; return true; diff --git a/gcc/rtl.h b/gcc/rtl.h index b29afca8d6b..b0b1aacd2e8 100644 --- a/gcc/rtl.h +++ b/gcc/rtl.h @@ -3500,7 +3500,7 @@ extern void add_args_size_note (rtx_insn *, poly_int64); extern void add_shallow_copy_of_reg_note (rtx_insn *, rtx); extern rtx duplicate_reg_note (rtx); extern void remove_note (rtx_insn *, const_rtx); -extern bool remove_reg_equal_equiv_notes (rtx_insn *); +extern bool remove_reg_equal_equiv_notes (rtx_insn *, bool = false); extern void remove_reg_equal_equiv_notes_for_regno (unsigned int); extern int side_effects_p (const_rtx); extern int volatile_refs_p (const_rtx); diff --git a/gcc/rtlanal.c b/gcc/rtlanal.c index 0ebde7622db..9ff17caaba0 100644 --- a/gcc/rtlanal.c +++ b/gcc/rtlanal.c @@ -2480,10 +2480,11 @@ remove_note (rtx_insn *insn, const_rtx note) } /* Remove REG_EQUAL and/or REG_EQUIV notes if INSN has such notes. - Return true if any note has been removed. */ + If NO_RESCAN is false and any notes were removed, call + df_notes_rescan. Return true if any note has been removed. */ bool -remove_reg_equal_equiv_notes (rtx_insn *insn) +remove_reg_equal_equiv_notes (rtx_insn *insn, bool no_rescan) { rtx *loc; bool ret = false; @@ -2500,6 +2501,8 @@ remove_reg_equal_equiv_notes (rtx_insn *insn) else loc = &XEXP (*loc, 1); } + if (ret && !no_rescan) + df_notes_rescan (insn); return ret; } -- 2.30.2