diff options
author | John David Anglin <dave.anglin@nrc-cnrc.gc.ca> | 2003-03-22 18:53:08 +0000 |
---|---|---|
committer | John David Anglin <danglin@gcc.gnu.org> | 2003-03-22 18:53:08 +0000 |
commit | 02a57c739e5928a65e99261c692203ddd52d7ec7 (patch) | |
tree | 7da17decc38c69fa495d2096189f3f5798ab989c | |
parent | 97c6f7ad7363ba6842373bbf8e14f9a34b5db413 (diff) | |
download | gcc-02a57c739e5928a65e99261c692203ddd52d7ec7.zip gcc-02a57c739e5928a65e99261c692203ddd52d7ec7.tar.gz gcc-02a57c739e5928a65e99261c692203ddd52d7ec7.tar.bz2 |
pa.c (output_cbranch, [...]): Output nop for conditional branch to the following instruction.
* pa.c (output_cbranch, output_bb, output_bvb): Output nop for
conditional branch to the following instruction. Use next_real_insn
instead of next_active_insn.
(output_dbra, output_movb, jump_in_call_delay): Use next_real_insn
instead of next_active_insn.
From-SVN: r64723
-rw-r--r-- | gcc/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/config/pa/pa.c | 31 |
2 files changed, 26 insertions, 13 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c7d76cb..c426f51 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2003-03-22 John David Anglin <dave.anglin@nrc-cnrc.gc.ca> + + * pa.c (output_cbranch, output_bb, output_bvb): Output nop for + conditional branch to the following instruction. Use next_real_insn + instead of next_active_insn. + (output_dbra, output_movb, jump_in_call_delay): Use next_real_insn + instead of next_active_insn. + 2003-03-22 Ulrich Weigand <uweigand@de.ibm.com> * config/s390/s390.md ("movti", "*movdi_31", "*movdf_31"): Use 'o' instead diff --git a/gcc/config/pa/pa.c b/gcc/config/pa/pa.c index 83205ba..2a79f85 100644 --- a/gcc/config/pa/pa.c +++ b/gcc/config/pa/pa.c @@ -5549,13 +5549,18 @@ output_cbranch (operands, nullify, length, negated, insn) int useskip = 0; rtx xoperands[5]; - /* A conditional branch to the following instruction (eg the delay slot) is - asking for a disaster. This can happen when not optimizing. + /* A conditional branch to the following instruction (eg the delay slot) + is asking for a disaster. This can happen when not optimizing and + when jump optimization fails. - In such cases it is safe to emit nothing. */ + While it usually safe to emit nothing, this can fail if the preceding + instruction is a nullified branch with an empty delay slot and the + same branch target as this branch. We could check for this but + jump optimization should eliminate these jumps. It is always + safe to emit a nop. */ - if (next_active_insn (JUMP_LABEL (insn)) == next_active_insn (insn)) - return ""; + if (next_real_insn (JUMP_LABEL (insn)) == next_real_insn (insn)) + return "nop"; /* If this is a long branch with its delay slot unfilled, set `nullify' as it can nullify the delay slot and save a nop. */ @@ -5851,8 +5856,8 @@ output_bb (operands, nullify, length, negated, insn, which) is only used when optimizing; jump optimization should eliminate the jump. But be prepared just in case. */ - if (next_active_insn (JUMP_LABEL (insn)) == next_active_insn (insn)) - return ""; + if (next_real_insn (JUMP_LABEL (insn)) == next_real_insn (insn)) + return "nop"; /* If this is a long branch with its delay slot unfilled, set `nullify' as it can nullify the delay slot and save a nop. */ @@ -5999,8 +6004,8 @@ output_bvb (operands, nullify, length, negated, insn, which) is only used when optimizing; jump optimization should eliminate the jump. But be prepared just in case. */ - if (next_active_insn (JUMP_LABEL (insn)) == next_active_insn (insn)) - return ""; + if (next_real_insn (JUMP_LABEL (insn)) == next_real_insn (insn)) + return "nop"; /* If this is a long branch with its delay slot unfilled, set `nullify' as it can nullify the delay slot and save a nop. */ @@ -6140,7 +6145,7 @@ output_dbra (operands, insn, which_alternative) /* A conditional branch to the following instruction (eg the delay slot) is asking for a disaster. Be prepared! */ - if (next_active_insn (JUMP_LABEL (insn)) == next_active_insn (insn)) + if (next_real_insn (JUMP_LABEL (insn)) == next_real_insn (insn)) { if (which_alternative == 0) return "ldo %1(%0),%0"; @@ -6247,7 +6252,7 @@ output_movb (operands, insn, which_alternative, reverse_comparison) /* A conditional branch to the following instruction (eg the delay slot) is asking for a disaster. Be prepared! */ - if (next_active_insn (JUMP_LABEL (insn)) == next_active_insn (insn)) + if (next_real_insn (JUMP_LABEL (insn)) == next_real_insn (insn)) { if (which_alternative == 0) return "copy %1,%0"; @@ -7585,9 +7590,9 @@ jump_in_call_delay (insn) if (PREV_INSN (insn) && PREV_INSN (PREV_INSN (insn)) - && GET_CODE (next_active_insn (PREV_INSN (PREV_INSN (insn)))) == INSN) + && GET_CODE (next_real_insn (PREV_INSN (PREV_INSN (insn)))) == INSN) { - rtx test_insn = next_active_insn (PREV_INSN (PREV_INSN (insn))); + rtx test_insn = next_real_insn (PREV_INSN (PREV_INSN (insn))); return (GET_CODE (PATTERN (test_insn)) == SEQUENCE && XVECEXP (PATTERN (test_insn), 0, 1) == insn); |