https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97252
--- Comment #3 from Alex Coplan <acoplan at gcc dot gnu.org> ---
FWIW, for the related testcase (which we also ICE on):
typedef int __attribute((vector_size(16))) V;
V v;
void f() { v = (V){4095}; }
clang pushes the constant out to the constant pool:
$ clang -target arm ice.c -c -S -o - -O2 -march=armv8.1-m.main+mve -mpure-code
-mfloat-abi=hard
[...]
f:
.fnstart
@ %bb.0:
movw r0, :lower16:.LCP0_0
movw r1, :lower16:v
movt r0, :upper16:.LCP0_0
movt r1, :upper16:v
vldrw.u32 q0, [r0]
vstrw.32 q0, [r1]
bx lr
.Lfunc_end0:
.size f, .Lfunc_end0-f
.cantunwind
.fnend
@ -- End function
.type v,%object @ @v
.comm v,16,8
.type .LCP0_0,%object @ @.LCP0_0
.section .rodata,"a",%progbits
.p2align 4
.LCP0_0:
.long 4095 @ 0xfff
.long 0 @ 0x0
.long 0 @ 0x0
.long 0 @ 0x0
.size .LCP0_0, 16
I think we should do the same.