re PR target/84336 (ICE in extract_insn, at recog.c:2304)
authorJakub Jelinek <jakub@redhat.com>
Tue, 13 Feb 2018 08:31:58 +0000 (09:31 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Tue, 13 Feb 2018 08:31:58 +0000 (09:31 +0100)
PR target/84336
* config/i386/sse.md (<avx512>_vpermi2var<mode>3_mask): Force
operands[2] into a REG before using gen_lowpart on it.

* gcc.target/i386/pr84336.c: New test.

From-SVN: r257616

gcc/ChangeLog
gcc/config/i386/sse.md
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/i386/pr84336.c [new file with mode: 0644]

index a74c8610443bd802525f972114e6d79029f34458..5ca6058ce52551d64721684cdc368ac99fbebb3b 100644 (file)
@@ -1,3 +1,9 @@
+2018-02-13  Jakub Jelinek  <jakub@redhat.com>
+
+       PR target/84336
+       * config/i386/sse.md (<avx512>_vpermi2var<mode>3_mask): Force
+       operands[2] into a REG before using gen_lowpart on it.
+
 2018-02-12  Jeff Law  <law@redhat.com>
 
        PR target/83760
index da9af2367ae4aa7fa4a9781c28e932b39553d987..26c4f5227f64d9b54860486d88c353ae31de6fd0 100644 (file)
          (match_dup 5)
          (match_operand:<avx512fmaskmode> 4 "register_operand")))]
   "TARGET_AVX512F"
-  "operands[5] = gen_lowpart (<MODE>mode, operands[2]);")
+{
+  operands[2] = force_reg (<sseintvecmode>mode, operands[2]);
+  operands[5] = gen_lowpart (<MODE>mode, operands[2]);
+})
 
 (define_insn "*<avx512>_vpermi2var<mode>3_mask"
   [(set (match_operand:VPERMI2I 0 "register_operand" "=v")
index 40261753993ad4571585bc096d177f2192fb5283..c1926e7c2000cec3214389272b29bdaf61d51eff 100644 (file)
@@ -1,3 +1,8 @@
+2018-02-13  Jakub Jelinek  <jakub@redhat.com>
+
+       PR target/84336
+       * gcc.target/i386/pr84336.c: New test.
+
 2018-02-12  Jakub Jelinek  <jakub@redhat.com>
 
        PR c++/84341
diff --git a/gcc/testsuite/gcc.target/i386/pr84336.c b/gcc/testsuite/gcc.target/i386/pr84336.c
new file mode 100644 (file)
index 0000000..3218116
--- /dev/null
@@ -0,0 +1,13 @@
+/* PR target/84336 */
+/* { dg-do compile } */
+/* { dg-options "-O0 -ftree-ter -mavx512f" } */
+
+#include <x86intrin.h>
+
+struct S { __m512i h; } b;
+
+__m512
+foo (__m512 a, __mmask16 c, __m512 d)
+{
+  return _mm512_mask2_permutex2var_ps (a, b.h, c, d);
+}