re PR target/20650 (float.c fails to build with weird error message)
authorGeoffrey Keating <geoffk@apple.com>
Sat, 2 Apr 2005 09:58:36 +0000 (09:58 +0000)
committerGeoffrey Keating <geoffk@gcc.gnu.org>
Sat, 2 Apr 2005 09:58:36 +0000 (09:58 +0000)
PR 20650
* config/rs6000/rs6000.md (fix_truncdfsi2): Make destination
a register.

From-SVN: r97435

gcc/ChangeLog
gcc/config/rs6000/rs6000.md
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/rs6000-fpint.c [new file with mode: 0644]

index a827229ad5f256fe6fb98b6ea44f005dcd64888e..26b9d0ff87e044ca432c74021aade5742823fc17 100644 (file)
@@ -1,5 +1,9 @@
 2005-04-02  Geoffrey Keating  <geoffk@apple.com>
 
+       PR 20650
+       * config/rs6000/rs6000.md (fix_truncdfsi2): Make destination
+       a register.
+
        * config/rs6000/t-darwin (TARGET_LIBGCC2_CFLAGS): Add -pipe.
        * config/t-darwin (TARGET_LIBGCC2_CFLAGS): Likewise.
 
index 916f39157dbed25bfead04c957585db4b7aaf0e3..d97d3be1077655f51d7b1caa9a1addea2bdcb026 100644 (file)
   DONE;
 }")
 
+; In the TARGET_PPC_GFXOPT case, this could and probably should
+; take a memory destination; but actually making this work is hard.
 (define_expand "fix_truncdfsi2"
-  [(parallel [(set (match_operand:SI 0 "reg_or_mem_operand" "")
+  [(parallel [(set (match_operand:SI 0 "gpc_reg_operand" "")
                   (fix:SI (match_operand:DF 1 "gpc_reg_operand" "")))
              (clobber (match_dup 2))
              (clobber (match_dup 3))])]
index 2f207eb36679a8420bde2003de58bbc42ae28c93..b8c472441313f17be27121797c04c24ea7a35abc 100644 (file)
@@ -1,3 +1,7 @@
+2005-04-02  Geoffrey Keating  <geoffk@apple.com>
+
+       * gcc.dg/rs6000-fpint.c: New.
+
 2005-04-01  Joseph S. Myers  <joseph@codesourcery.com>
 
        * gcc.dg/old-style-then-proto-1.c: New test.
diff --git a/gcc/testsuite/gcc.dg/rs6000-fpint.c b/gcc/testsuite/gcc.dg/rs6000-fpint.c
new file mode 100644 (file)
index 0000000..410f780
--- /dev/null
@@ -0,0 +1,11 @@
+/* { dg-do compile { target powerpc*-*-* rs6000-*-* } } */
+/* { dg-options "-mno-powerpc-gfxopt" } */
+/* { dg-final { scan-assembler-not "stfiwx" } } */
+
+/* A basic test of the old-style (not stfiwx) fp -> int conversion.  */
+int f(double a, double b)
+{
+  int a1 = a;
+  int b1 = b;
+  return a1+b1;
+}