From: Jakub Jelinek Date: Sat, 25 Nov 2023 09:30:39 +0000 (+0100) Subject: aarch64: Fix up aarch64_simd_stp [PR109977] X-Git-Tag: basepoints/gcc-15~4299 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a6a43a3b763816fec7c4eec6ae7be5b263dff340;p=thirdparty%2Fgcc.git aarch64: Fix up aarch64_simd_stp [PR109977] The aarch64_simd_stp pattern uses w constraint in one alternative and r in another, but for the latter incorrectly uses iterator in %1 which expands to %d1 for V2DF and %s1 for V2SF and V4SF (this one not relevant to the pattern) and %w1 for others, so it ICEs if the alternative is selected during final. Compared to this, macro has the same values for all modes but uses w for V2DF and V2SF. 2023-11-24 Andrew Pinski Jakub Jelinek PR target/109977 * config/aarch64/aarch64-simd.md (aarch64_simd_stp): Use rather than % for alternative with r constraint on input operand. * gcc.dg/pr109977.c: New test. --- diff --git a/gcc/config/aarch64/aarch64-simd.md b/gcc/config/aarch64/aarch64-simd.md index 80e338bb8952..ad79a8110a53 100644 --- a/gcc/config/aarch64/aarch64-simd.md +++ b/gcc/config/aarch64/aarch64-simd.md @@ -269,7 +269,7 @@ "TARGET_SIMD" {@ [ cons: =0 , 1 ; attrs: type ] [ Umn , w ; neon_stp ] stp\t%1, %1, %y0 - [ Umn , r ; store_ ] stp\t%1, %1, %y0 + [ Umn , r ; store_ ] stp\t%1, %1, %y0 } ) diff --git a/gcc/testsuite/gcc.dg/pr109977.c b/gcc/testsuite/gcc.dg/pr109977.c new file mode 100644 index 000000000000..03d9a3331348 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr109977.c @@ -0,0 +1,16 @@ +/* PR target/109977 */ +/* { dg-do compile } */ +/* { dg-options "-Og" } */ + +typedef double __attribute__((__vector_size__ (8))) V; +typedef double __attribute__((__vector_size__ (16))) W; +V v; +int i; +extern void bar (void *); + +void +foo (void) +{ + W w = __builtin_shufflevector (v, (W) { }, 0, 0); + bar (&w); +}