From f4b29321048fa82c754f04814dbd46d92773e72a Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Tue, 13 Feb 2018 09:31:58 +0100 Subject: [PATCH] re PR target/84336 (ICE in extract_insn, at recog.c:2304) PR target/84336 * config/i386/sse.md (_vpermi2var3_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 | 6 ++++++ gcc/config/i386/sse.md | 5 ++++- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.target/i386/pr84336.c | 13 +++++++++++++ 4 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/gcc.target/i386/pr84336.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a74c8610443..5ca6058ce52 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2018-02-13 Jakub Jelinek + + PR target/84336 + * config/i386/sse.md (_vpermi2var3_mask): Force + operands[2] into a REG before using gen_lowpart on it. + 2018-02-12 Jeff Law PR target/83760 diff --git a/gcc/config/i386/sse.md b/gcc/config/i386/sse.md index da9af2367ae..26c4f5227f6 100644 --- a/gcc/config/i386/sse.md +++ b/gcc/config/i386/sse.md @@ -18183,7 +18183,10 @@ (match_dup 5) (match_operand: 4 "register_operand")))] "TARGET_AVX512F" - "operands[5] = gen_lowpart (mode, operands[2]);") +{ + operands[2] = force_reg (mode, operands[2]); + operands[5] = gen_lowpart (mode, operands[2]); +}) (define_insn "*_vpermi2var3_mask" [(set (match_operand:VPERMI2I 0 "register_operand" "=v") diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 40261753993..c1926e7c200 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2018-02-13 Jakub Jelinek + + PR target/84336 + * gcc.target/i386/pr84336.c: New test. + 2018-02-12 Jakub Jelinek 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 index 00000000000..3218116af56 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr84336.c @@ -0,0 +1,13 @@ +/* PR target/84336 */ +/* { dg-do compile } */ +/* { dg-options "-O0 -ftree-ter -mavx512f" } */ + +#include + +struct S { __m512i h; } b; + +__m512 +foo (__m512 a, __mmask16 c, __m512 d) +{ + return _mm512_mask2_permutex2var_ps (a, b.h, c, d); +} -- 2.30.2