re PR target/79197 (ICE in extract_insn in gcc/recog.c:2311)
authorJakub Jelinek <jakub@redhat.com>
Thu, 2 Feb 2017 10:05:26 +0000 (11:05 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Thu, 2 Feb 2017 10:05:26 +0000 (11:05 +0100)
PR target/79197
* config/rs6000/rs6000.md (*fixuns_trunc<mode>di2_fctiduz): Rename to ...
(fixuns_trunc<mode>di2): ... this, remove previous expander.  Put all
conditions on a single line.

* gcc.target/powerpc/pr79197.c: New test.
* gcc.c-torture/compile/pr79197.c: New test.

From-SVN: r245120

gcc/ChangeLog
gcc/config/rs6000/rs6000.md
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/compile/pr79197.c [new file with mode: 0644]
gcc/testsuite/gcc.target/powerpc/pr79197.c [new file with mode: 0644]

index 4e3570d06cd6bdd9a9ad07bc6c4fc2c6a7e3db6e..26da5e89cd7071697041f7f101bd184d9f54944a 100644 (file)
@@ -1,3 +1,10 @@
+2017-02-02  Jakub Jelinek  <jakub@redhat.com>
+
+       PR target/79197
+       * config/rs6000/rs6000.md (*fixuns_trunc<mode>di2_fctiduz): Rename to ...
+       (fixuns_trunc<mode>di2): ... this, remove previous expander.  Put all
+       conditions on a single line.
+
 2017-02-02  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>
 
        * config/s390/s390-c.c (s390_cpu_cpp_builtins_internal): Rename
index 7a908acb88ee6c8c48f94704dd33b53924a42d34..bb0927ffb2f6e65c9deed6a679447cadcc693a20 100644 (file)
   [(set_attr "length" "12")
    (set_attr "type" "fp")])
 
-(define_expand "fixuns_trunc<mode>di2"
-  [(set (match_operand:DI 0 "register_operand" "")
-       (unsigned_fix:DI (match_operand:SFDF 1 "register_operand" "")))]
-  "TARGET_HARD_FLOAT && (TARGET_FCTIDUZ || VECTOR_UNIT_VSX_P (<MODE>mode))"
-  "")
-
-(define_insn "*fixuns_trunc<mode>di2_fctiduz"
+(define_insn "fixuns_trunc<mode>di2"
   [(set (match_operand:DI 0 "gpc_reg_operand" "=d,wi")
        (unsigned_fix:DI (match_operand:SFDF 1 "gpc_reg_operand" "<Ff>,<Fv>")))]
-  "TARGET_HARD_FLOAT && TARGET_DOUBLE_FLOAT && TARGET_FPRS
-    && TARGET_FCTIDUZ"
+  "TARGET_HARD_FLOAT && TARGET_DOUBLE_FLOAT && TARGET_FPRS && TARGET_FCTIDUZ"
   "@
    fctiduz %0,%1
    xscvdpuxds %x0,%x1"
index ecf9aece6e5bae3d629499623013f245c5e064f2..cc5da33a72f0dc318e8eea455eecad3f6c571ade 100644 (file)
@@ -1,3 +1,9 @@
+2017-02-02  Jakub Jelinek  <jakub@redhat.com>
+
+       PR target/79197
+       * gcc.target/powerpc/pr79197.c: New test.
+       * gcc.c-torture/compile/pr79197.c: New test.
+
 2017-02-02  Richard Biener  <rguenther@suse.de>
 
        * gcc.dg/tree-ssa/pr71078-3.c: Do not rely on math.h.
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr79197.c b/gcc/testsuite/gcc.c-torture/compile/pr79197.c
new file mode 100644 (file)
index 0000000..f3ac71a
--- /dev/null
@@ -0,0 +1,10 @@
+/* PR target/79197 */
+
+unsigned long b;
+
+unsigned long
+foo (float *a, float *x)
+{
+  __builtin_memcpy (a, x, sizeof (float));
+  return *a;
+}
diff --git a/gcc/testsuite/gcc.target/powerpc/pr79197.c b/gcc/testsuite/gcc.target/powerpc/pr79197.c
new file mode 100644 (file)
index 0000000..659d76c
--- /dev/null
@@ -0,0 +1,11 @@
+/* PR target/79197 */
+/* { dg-do compile } */
+/* { dg-options "-O0 -mno-popcntd" } */
+
+unsigned a;
+
+void
+foo (void)
+{
+  a = *(double *) (__UINTPTR_TYPE__) 0x400000;
+}