https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99647
Bug ID: 99647 Summary: arm: GCC generates invalid MVE vmov instruction Product: gcc Version: 11.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: acoplan at gcc dot gnu.org Target Milestone: --- We generate invalid assembly for the following testcase: $ cat test.c typedef int __attribute((vector_size(16))) V; V f(void) { return (V){ (int)f, (int)f, (int)f, (int)f }; } $ arm-eabi-gcc -c test.c -O2 -march=armv8.1-m.main+mve -mfloat-abi=hard /tmp/ccSbIMAM.s: Assembler messages: /tmp/ccSbIMAM.s:29: Error: expected <Rm> or <Dm> or <Qm> operand -- `vmov.32 q0,#f' It looks like we're trying to use a label on the RHS of a vmov instruction: f: @ args = 0, pretend = 0, frame = 0 @ frame_needed = 0, uses_anonymous_args = 0 @ link register save eliminated. vmov.32 q0, #f bx lr This can also be seen through autovec in the testsuite. In particular gcc/testsuite/gcc.dg/torture/pr47958-1.c fails at -O3 in the same way: $ arm-eabi-gcc -c gcc/testsuite/gcc.dg/torture/pr47958-1.c -c -O3 -march=armv8.1-m.main+mve -mfloat-abi=hard /tmp/cc09hQWF.s: Assembler messages: /tmp/cc09hQWF.s:42: Error: expected <Rm> or <Dm> or <Qm> operand -- `vmov.32 q3,#bar' I noticed this while working on PR97252 which is a separate problem with MVE vector moves.