aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>2005-04-01 15:27:58 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2005-04-01 15:27:58 +0000
commita278573900ad32231f8d3412cd06b3cc37ac749c (patch)
tree94ca730dbecf565a2483825a96b538ba2fd4a784
parent4159401a0d4eba0bfa57f040e27aea8ef6a23343 (diff)
downloadgcc-a278573900ad32231f8d3412cd06b3cc37ac749c.zip
gcc-a278573900ad32231f8d3412cd06b3cc37ac749c.tar.gz
gcc-a278573900ad32231f8d3412cd06b3cc37ac749c.tar.bz2
final.c (final_scan_insn): Revert part of 2005-03-30 patch...
* 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. From-SVN: r97399
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/final.c14
2 files changed, 19 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 56a2879..02d6e23 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2005-04-01 Ian Lance Taylor <ian@airs.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.
+
2005-04-01 Kazu Hirata <kazu@cs.umass.edu>
* bb-reorder.c, fold-const.c, varasm.c: Fix comment typos.
diff --git a/gcc/final.c b/gcc/final.c
index 7633724..ea84255 100644
--- a/gcc/final.c
+++ b/gcc/final.c
@@ -2306,11 +2306,23 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED,
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. */