This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] More REG_EQ* notes related changes


Hello,

This patch changes find_reg_equal_equiv_note to be consistent with what 
set_unique_reg_note does for REG_EQUAL/REG_EQUIV notes: Do not expect
to have them on insns with multiple sets.

Bootstrapped&tested on i686-pc-linux-gnu.  OK for the trunk?

Gr.
Steven

	* rtlanal.c (find_reg_equal_equiv_note): Do not find REG_EQ*
	notes on an insn with multiple sets, even if single_set returns
	non-NULL for that insn.
	
Index: rtlanal.c
===================================================================
--- rtlanal.c	(revision 122166)
+++ rtlanal.c	(working copy)
@@ -1676,11 +1676,18 @@ find_reg_equal_equiv_note (rtx insn)
 
   if (!INSN_P (insn))
     return 0;
+
   for (link = REG_NOTES (insn); link; link = XEXP (link, 1))
     if (REG_NOTE_KIND (link) == REG_EQUAL
 	|| REG_NOTE_KIND (link) == REG_EQUIV)
       {
-	if (single_set (insn) == 0)
+	/* FIXME: We should never have REG_EQUAL/REG_EQUIV notes on
+	   insns that have multiple sets.  Checking single_set to
+	   make sure of this is not the proper check, as explained
+	   in the comment in set_unique_reg_note.
+
+	   This should be changed into an assert.  */
+	if (GET_CODE (PATTERN (insn)) == PARALLEL && multiple_sets (insn))
 	  return 0;
 	return link;
       }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]