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 COMMITTED: Revert part of 2005-03-30 patch to final.c


As noted here
    http://gcc.gnu.org/ml/gcc-patches/2005-03/msg02843.html
my patch of 2005-03-30 caused a bootstrap failure on
sh4-unknown-linux-gnu.  It turns out that the SH backend does rescan
instructions in some cases when turning a branch with a filled delay
slot into a far jump.  This patch reverts a portion of my earlier
patch to avoid this problem.

Committed as obvious.

Ian


2005-04-01  Ian Lance Taylor  <ian@c2micro.com>

	* final.c (final_scan_insn): Revert part of 2005-03-30 patch: when
	doing a peephole optimization, once again put any notes in the
	proper position.


Index: final.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/final.c,v
retrieving revision 1.348
diff -p -u -r1.348 final.c
--- final.c	31 Mar 2005 14:59:50 -0000	1.348
+++ final.c	1 Apr 2005 15:23:47 -0000
@@ -2306,11 +2306,23 @@ final_scan_insn (rtx insn, FILE *file, i
 	       emit them before the peephole.  */
 	    if (next != 0 && next != NEXT_INSN (insn))
 	      {
-		rtx note;
+		rtx note, prev = PREV_INSN (insn);
 
 		for (note = NEXT_INSN (insn); note != next;
 		     note = NEXT_INSN (note))
 		  final_scan_insn (note, file, optimize, nopeepholes, seen);
+
+		/* Put the notes in the proper position for a later
+		   rescan.  For example, the SH target can do this
+		   when generating a far jump in a delayed branch
+		   sequence.  */
+		note = NEXT_INSN (insn);
+		PREV_INSN (note) = prev;
+		NEXT_INSN (prev) = note;
+		NEXT_INSN (PREV_INSN (next)) = insn;
+		PREV_INSN (insn) = PREV_INSN (next);
+		NEXT_INSN (insn) = next;
+		PREV_INSN (next) = insn;
 	      }
 
 	    /* PEEPHOLE might have changed this.  */


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