]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
pa.c (output_cbranch, [...]): Output nop for conditional branch to the following...
authorJohn David Anglin <dave.anglin@nrc-cnrc.gc.ca>
Sat, 22 Mar 2003 19:25:06 +0000 (19:25 +0000)
committerJohn David Anglin <danglin@gcc.gnu.org>
Sat, 22 Mar 2003 19:25:06 +0000 (19:25 +0000)
* pa.c (output_cbranch, output_bb, output_bvb): Output nop for
conditional branch to the following instruction.

From-SVN: r64725

gcc/ChangeLog
gcc/config/pa/pa.c

index 9a637af46c755361fb46db68b1dfae7cb48ee7f1..f239816e285b0329bb88cf3fa839593e70a985e8 100644 (file)
@@ -1,3 +1,8 @@
+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.
+
 2003-03-21  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
 
        PR doc-bug/9813
index 0e17b4e34a91ab22e876ad651005afaa554cdc60..e00681efac898cdb492c6fb84ba12db595807726 100644 (file)
@@ -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.  */