This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[committed] PR 34831: ICE generating reciprocals on MIPS
- From: Richard Sandiford <rsandifo at nildram dot co dot uk>
- To: gcc-patches at gcc dot gnu dot org
- Date: Sun, 20 Jan 2008 00:05:54 +0000
- Subject: [committed] PR 34831: ICE generating reciprocals on MIPS
PR 34831 is a case where the define_expands don't match the define_insn
conditions for 32-bit MIPS IV+ code.
Fixed with patch below. Regression-tested on mips64-linux-gnu (with a
checkout from before the global.c change) and applied.
Richard
gcc/
PR target/34831
* config/mips/mips.md (div<mode>3): Use <recip_condition> when
deciding whether to use reciprocal instructions.
gcc/testsuite/
PR target/34831
* gcc.target/mips/pr34831.c: New test.
Index: gcc/config/mips/mips.md
===================================================================
--- gcc/config/mips/mips.md 2008-01-19 23:53:19.000000000 +0000
+++ gcc/config/mips/mips.md 2008-01-19 23:59:02.000000000 +0000
@@ -1936,7 +1936,7 @@ (define_expand "div<mode>3"
"<divide_condition>"
{
if (const_1_operand (operands[1], <MODE>mode))
- if (!(ISA_HAS_FP4 && flag_unsafe_math_optimizations))
+ if (!(<recip_condition> && flag_unsafe_math_optimizations))
operands[1] = force_reg (<MODE>mode, operands[1]);
})
Index: gcc/testsuite/gcc.target/mips/pr34831.c
===================================================================
--- /dev/null 2008-01-18 22:34:47.552097000 +0000
+++ gcc/testsuite/gcc.target/mips/pr34831.c 2008-01-20 00:02:08.000000000 +0000
@@ -0,0 +1,7 @@
+/* { dg-mips-options "-ffast-math -mips64 -mgp32" } */
+
+double
+foo (void)
+{
+ return __builtin_pow (0.0, -1.5);
+}