diff mbox series

[v2] csa: Fix --enable-checking=yes, df bootstrap failure in csa [PR94961]

Message ID 20200507101759.GM8462@tucnak
State New
Headers show
Series [v2] csa: Fix --enable-checking=yes, df bootstrap failure in csa [PR94961] | expand

Commit Message

Jakub Jelinek May 7, 2020, 10:17 a.m. UTC
On Thu, May 07, 2020 at 10:40:12AM +0200, Eric Botcazou wrote:
> OK, let's add a parameter no_rescan to remove_reg_equal_equiv_notes and update 
> the two callers accordingly.

I'll try following then.

2020-05-07  Jakub Jelinek  <jakub@redhat.com>

        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.



	Jakub

Comments

Eric Botcazou May 7, 2020, 10:31 a.m. UTC | #1
> I'll try following then.
> 
> 2020-05-07  Jakub Jelinek  <jakub@redhat.com>
> 
>         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.

OK with me modulo the missing documentation for the new parameter, thanks.
diff mbox series

Patch

--- gcc/rtl.h.jj	2020-04-02 14:28:02.000000000 +0200
+++ gcc/rtl.h	2020-05-07 11:24:17.745856904 +0200
@@ -3500,7 +3500,7 @@  extern void add_args_size_note (rtx_insn
 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);
--- gcc/rtlanal.c.jj	2020-04-29 10:21:25.062999858 +0200
+++ gcc/rtlanal.c	2020-05-07 11:25:18.033937373 +0200
@@ -2483,7 +2483,7 @@  remove_note (rtx_insn *insn, const_rtx n
    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 +2500,8 @@  remove_reg_equal_equiv_notes (rtx_insn *
       else
 	loc = &XEXP (*loc, 1);
     }
+  if (ret && !no_rescan)
+    df_notes_rescan (insn);
   return ret;
 }
 
--- gcc/combine.c.jj	2020-05-06 09:30:48.995407357 +0200
+++ gcc/combine.c	2020-05-07 11:25:34.302689241 +0200
@@ -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
--- gcc/postreload.c.jj	2020-05-05 16:34:33.611007861 +0200
+++ gcc/postreload.c	2020-05-07 11:26:13.506091307 +0200
@@ -1223,11 +1223,10 @@  reload_combine_recognize_pattern (rtx_in
 	      /* 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;