diff mbox

[lra] patch to fix an arm testsuite degradation

Message ID 4EF4EDF6.7050907@redhat.com
State New
Headers show

Commit Message

Vladimir Makarov Dec. 23, 2011, 9:09 p.m. UTC
The following patch fixes a degradation of 20060102-1.c  on ARM.  Not 
updating REG notes resulted in removing an insn after LRA as it was 
wrongly considered dead.

The patch was successfully bootstrapped on x86/x86-64.

Committed as rev. 182664.

2011-12-23  Vladimir Makarov <vmakarov@redhat.com>

         * lra.c (update_auto_inc_notes): Rename to update_reg_notes.  Make
         it unconditional.  Remove REG_DEAD and REG_UNUSED too.  Make call
         of add_auto_inc_notes conditional.

Comments

Paolo Carlini Dec. 23, 2011, 9:17 p.m. UTC | #1
Hi Vladimir,

> The following patch fixes a degradation of 20060102-1.c  on ARM.

unless I'm badly mistaken, I see you using quite often the form 'degradation', which is somewhat unusual in this mailing list. Are you using it like 'regression' or you actually mean something slightly, subtly, different?

A bit off topic, sorry,
Paolo
Vladimir Makarov Dec. 23, 2011, 9:42 p.m. UTC | #2
On 12/23/2011 04:17 PM, Paolo Carlini wrote:
> Hi Vladimir,
>
>> The following patch fixes a degradation of 20060102-1.c  on ARM.
> unless I'm badly mistaken, I see you using quite often the form 'degradation', which is somewhat unusual in this mailing list. Are you using it like 'regression' or you actually mean something slightly, subtly, different?
>
Paolo, thanks for pointing this out.  You are right.  I frequently 
wrongly use this word.  I should use regression.
diff mbox

Patch

Index: lra.c
===================================================================
--- lra.c	(revision 182663)
+++ lra.c	(working copy)
@@ -2032,10 +2032,14 @@  add_auto_inc_notes (rtx insn, rtx x)
     }
 }
 
-/* DF infrastructure does not deal with REG_INC notes -- so update
-   them here.  */
+#endif
+
+/* Remove all REG_DEAD and REG_UNUSED notes and regenerate REG_INC.
+   We change pseudos by hard registers without notification of DF and
+   that can make the notes obsolete.  DF-infrastructure does not deal
+   with REG_INC notes -- so we should regenerate them here.  */
 static void
-update_auto_inc_notes (void)
+update_reg_notes (void)
 {
   rtx *pnote;
   basic_block bb;
@@ -2048,17 +2052,19 @@  update_auto_inc_notes (void)
 	pnote = &REG_NOTES (insn);
 	while (*pnote != 0)
 	  {
-	    if (REG_NOTE_KIND (*pnote) == REG_INC)
+	    if (REG_NOTE_KIND (*pnote) == REG_DEAD
+		|| REG_NOTE_KIND (*pnote) == REG_UNUSED
+		|| REG_NOTE_KIND (*pnote) == REG_INC)
 	      *pnote = XEXP (*pnote, 1);
 	    else
 	      pnote = &XEXP (*pnote, 1);
 	  }
+#ifdef AUTO_INC_DEC
 	add_auto_inc_notes (insn, PATTERN (insn));
+#endif
       }
 }
 
-#endif
-
 /* Set to 1 while in lra.  */
 int lra_in_progress;
 
@@ -2204,9 +2210,7 @@  lra (FILE *f)
   regstat_free_n_sets_and_refs ();
   regstat_free_ri ();
   reload_completed = 1;
-#ifdef AUTO_INC_DEC
-  update_auto_inc_notes ();
-#endif
+  update_reg_notes ();
   finish_subregs_of_mode ();
 
   inserted_p = fixup_abnormal_edges ();