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]

Re: [PATCH] fix broken dead notes after register renaming


right. attached the new version with new naming to commit if it's ok.

thanks

-c


Kenneth Zadeck wrote:
I am going to complain.

I think that this code is confusing.

the variable that you call "note", is not a note it is a reg. "x" is a
note.


Kenny


Index: gcc/gcc/regrename.c
===================================================================
--- gcc/gcc/regrename.c	(revision 151708)
+++ gcc/gcc/regrename.c	(working copy)
@@ -376,11 +376,26 @@
 	INSN_VAR_LOCATION_LOC (chain->insn) = gen_rtx_UNKNOWN_VAR_LOC ();
       else
 	{
+	  rtx note;
+
 	  *chain->loc = gen_raw_REG (GET_MODE (*chain->loc), reg);
 	  if (regno >= FIRST_PSEUDO_REGISTER)
 	    ORIGINAL_REGNO (*chain->loc) = regno;
 	  REG_ATTRS (*chain->loc) = attr;
 	  REG_POINTER (*chain->loc) = reg_ptr;
+
+	  for (note = REG_NOTES (chain->insn); note; note = XEXP (note, 1))
+	    {
+	      if (REG_NOTE_KIND (note) == REG_DEAD 
+		  || REG_NOTE_KIND (note) == REG_UNUSED)
+		{
+		  rtx reg = XEXP (note, 0);
+		  gcc_assert (HARD_REGISTER_P (reg));
+		  
+		  if (REGNO (reg) == base_regno) 
+		    XEXP (note, 0) = *chain->loc;
+		}
+	    }
 	}
 
       df_insn_rescan (chain->insn);

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