From: John David Anglin Date: Sat, 22 Mar 2003 19:25:06 +0000 (+0000) Subject: pa.c (output_cbranch, [...]): Output nop for conditional branch to the following... X-Git-Tag: releases/gcc-3.2.3~85 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f7723f22964555ebcdff584eec49d2674e23579c;p=thirdparty%2Fgcc.git 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. From-SVN: r64725 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 9a637af46c75..f239816e285b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2003-03-22 John David Anglin + + * pa.c (output_cbranch, output_bb, output_bvb): Output nop for + conditional branch to the following instruction. + 2003-03-21 Volker Reichelt PR doc-bug/9813 diff --git a/gcc/config/pa/pa.c b/gcc/config/pa/pa.c index 0e17b4e34a91..e00681efac89 100644 --- a/gcc/config/pa/pa.c +++ b/gcc/config/pa/pa.c @@ -5159,13 +5159,18 @@ output_cbranch (operands, nullify, length, negated, insn) static char buf[100]; int useskip = 0; - /* 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 ""; + 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. */ @@ -5369,7 +5374,7 @@ output_bb (operands, nullify, length, negated, insn, which) jump. But be prepared just in case. */ if (next_active_insn (JUMP_LABEL (insn)) == next_active_insn (insn)) - return ""; + 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. */ @@ -5517,7 +5522,7 @@ output_bvb (operands, nullify, length, negated, insn, which) jump. But be prepared just in case. */ if (next_active_insn (JUMP_LABEL (insn)) == next_active_insn (insn)) - return ""; + 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. */