This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] fix broken dead notes after register renaming
- From: Christian BRUEL <christian dot bruel at st dot com>
- To: Kenneth dot Zadeck at NaturalBridge dot com
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, Paolo Bonzini <bonzini at gnu dot org>
- Date: Tue, 15 Sep 2009 14:20:25 +0200
- Subject: Re: [PATCH] fix broken dead notes after register renaming
- References: <877hw1xw4y.fsf@lorien.watson.ibm.com>
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);