From: Steve Ellcey Date: Fri, 29 Jan 2016 16:29:58 +0000 (+0000) Subject: re PR target/65604 (MIPS -fno-delayed-branch generates incorrect code with -mcheck... X-Git-Tag: upstream/12.2.0~49087 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=87a5ab58c5ffe762d4ff8f76daa41846cdffa472;p=platform%2Fupstream%2Fgcc.git re PR target/65604 (MIPS -fno-delayed-branch generates incorrect code with -mcheck-zero-division) PR target/65604 * config/mips/mips.c (mips_output_division): Check flag_delayed_branch. From-SVN: r232985 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 9f99842..2450e4f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2016-01-29 Steve Ellcey + + PR target/65604 + * config/mips/mips.c (mips_output_division): Check flag_delayed_branch. + 2016-01-29 Jakub Jelinek PR target/69551 diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c index 84fbc97..9ec2dcb 100644 --- a/gcc/config/mips/mips.c +++ b/gcc/config/mips/mips.c @@ -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;