re PR target/65604 (MIPS -fno-delayed-branch generates incorrect code with -mcheck...
authorSteve Ellcey <sellcey@imgtec.com>
Fri, 29 Jan 2016 16:29:58 +0000 (16:29 +0000)
committerSteve Ellcey <sje@gcc.gnu.org>
Fri, 29 Jan 2016 16:29:58 +0000 (16:29 +0000)
PR target/65604
* config/mips/mips.c (mips_output_division): Check flag_delayed_branch.

From-SVN: r232985

gcc/ChangeLog
gcc/config/mips/mips.c

index 9f99842..2450e4f 100644 (file)
@@ -1,3 +1,8 @@
+2016-01-29  Steve Ellcey  <sellcey@imgtec.com>
+
+       PR target/65604
+       * config/mips/mips.c (mips_output_division): Check flag_delayed_branch.
+
 2016-01-29  Jakub Jelinek  <jakub@redhat.com>
 
        PR target/69551
index 84fbc97..9ec2dcb 100644 (file)
@@ -13712,9 +13712,17 @@ mips_output_division (const char *division, rtx *operands)
        }
       else
        {
-         output_asm_insn ("%(bne\t%2,%.,1f", operands);
-         output_asm_insn (s, operands);
-         s = "break\t7%)\n1:";
+         if (flag_delayed_branch)
+           {
+             output_asm_insn ("%(bne\t%2,%.,1f", operands);
+             output_asm_insn (s, operands);
+             s = "break\t7%)\n1:";
+           }
+         else
+           {
+             output_asm_insn (s, operands);
+             s = "bne\t%2,%.,1f\n\tnop\n\tbreak\t7\n1:";
+           }
        }
     }
   return s;