From: liuhongt Date: Mon, 7 Nov 2022 01:55:25 +0000 (+0800) Subject: Fix incorrect insn type to avoid ICE in memory attr auto-detection. X-Git-Tag: basepoints/gcc-14~3386 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=916bec9a05ea522c81381e0c93590d46965d9c7b;p=thirdparty%2Fgcc.git Fix incorrect insn type to avoid ICE in memory attr auto-detection. Memory attribute auto detection will check operand 2 for type sselog, and check operand 1 for type sselog1. For below 2 insns, there's no operand 2. Change type to sselog1. gcc/ChangeLog: PR target/107540 * config/i386/sse.md (avx512f_movddup512): Change type from sselog to sselog1. (avx_movddup256): Ditto. gcc/testsuite/ChangeLog: * gcc.target/i386/pr107540.c: New test. --- diff --git a/gcc/config/i386/sse.md b/gcc/config/i386/sse.md index 9a4fc01856dd..de632b2d8fe5 100644 --- a/gcc/config/i386/sse.md +++ b/gcc/config/i386/sse.md @@ -12203,7 +12203,7 @@ (const_int 6) (const_int 14)])))] "TARGET_AVX512F" "vmovddup\t{%1, %0|%0, %1}" - [(set_attr "type" "sselog") + [(set_attr "type" "sselog1") (set_attr "prefix" "evex") (set_attr "mode" "V8DF")]) @@ -12234,7 +12234,7 @@ (const_int 2) (const_int 6)])))] "TARGET_AVX && " "vmovddup\t{%1, %0|%0, %1}" - [(set_attr "type" "sselog") + [(set_attr "type" "sselog1") (set_attr "prefix" "") (set_attr "mode" "V4DF")]) diff --git a/gcc/testsuite/gcc.target/i386/pr107540.c b/gcc/testsuite/gcc.target/i386/pr107540.c new file mode 100644 index 000000000000..a0351ff9cb5c --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr107540.c @@ -0,0 +1,12 @@ +/* { dg-do compile } */ +/* { dg-options "-flive-range-shrinkage -mavx" } */ + +typedef double __attribute__((__vector_size__ (32))) V; + +V v; + +void +foo (void) +{ + v = __builtin_ia32_movddup256 (v); +}