Patchwork Fix PR rtl-optimization/54088

login
register
mail settings
Submitter Eric Botcazou
Date Aug. 25, 2012, 10:41 p.m.
Message ID <201208260041.48522.ebotcazou@adacore.com>
Download mbox | patch
Permalink /patch/179994/
State New
Headers show

Comments

Eric Botcazou - Aug. 25, 2012, 10:41 p.m.
This is a regression present on mainline and 4.7 branch and a variant of:
  http://gcc.gnu.org/ml/gcc-patches/2012-05/msg01076.html
The difference is that there is a barrier between the CALL_INSN and the 
CALL_ARG_LOCATION note (delete_related_insns is called from reorg.c and the dbr 
pass is run after the barriers pass, which puts the barrier there on purpose).

Tested on x86_64-suse-linux, applied on the mainline and 4.7 branch.


2012-08-25  Eric Botcazou  <ebotcazou@adacore.com>

	PR rtl-optimization/54088
	* jump.c (delete_related_insns): Robustify latest change.

Patch

Index: jump.c
===================================================================
--- jump.c	(revision 190665)
+++ jump.c	(working copy)
@@ -1260,9 +1260,9 @@  delete_related_insns (rtx insn)
 	  && GET_CODE (PATTERN (insn)) == SEQUENCE
 	  && CALL_P (XVECEXP (PATTERN (insn), 0, 0))))
     {
-      rtx p = insn;
+      rtx p;
 
-      for (p = NEXT_INSN (p);
+      for (p = next && INSN_DELETED_P (next) ? NEXT_INSN (next) : next;
 	   p && NOTE_P (p);
 	   p = NEXT_INSN (p))
 	if (NOTE_KIND (p) == NOTE_INSN_CALL_ARG_LOCATION)