]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
backport: re PR target/79197 (ICE in extract_insn in gcc/recog.c:2311)
authorJakub Jelinek <jakub@redhat.com>
Tue, 30 May 2017 07:56:11 +0000 (09:56 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Tue, 30 May 2017 07:56:11 +0000 (09:56 +0200)
Backported from mainline
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.

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

From-SVN: r248640

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 29623a10457a4162588a8e66474784a93a42e42d..760d4e02d7837853955165c52ec005626f2910c5 100644 (file)
@@ -1,6 +1,13 @@
 2017-05-30  Jakub Jelinek  <jakub@redhat.com>
 
        Backported from mainline
+       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.
+
        2016-12-13  Jakub Jelinek  <jakub@redhat.com>
 
        PR ipa/77905
index 7a8f6b5775ffb065607c28834d34d0c1bbd390c1..6ab47268be5ab13f23b2a6da8d9aac2f01314662 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>,<Fa>")))]
-  "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 4bc3ba0ca8d6a6857db3d5d11b4d96a57a20a8b6..92bbd88b19d9f1e18bdbe8836e10f402f641fc88 100644 (file)
@@ -1,6 +1,12 @@
 2017-05-30  Jakub Jelinek  <jakub@redhat.com>
 
        Backported from mainline
+       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-01-11  Jakub Jelinek  <jakub@redhat.com>
 
        PR c++/78341
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;
+}