https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99639
Bug ID: 99639 Summary: Duplicated constant in V2SI/V4SI Product: gcc Version: 11.0 Status: UNCONFIRMED Keywords: missed-optimization Severity: enhancement Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: pinskia at gcc dot gnu.org Target Milestone: --- Take C++ code: void foo(int (&arr)[42]) { for (unsigned i = 0; i < sizeof(arr) / sizeof(arr[0]); ++i) arr[i] = 43; } ---- CUT ---- Current we produce: foo(int (&) [42]): movi v0.4s, 0x2b movi v1.2s, 0x2b stp q0, q0, [x0] stp q0, q0, [x0, 32] stp q0, q0, [x0, 64] stp q0, q0, [x0, 96] stp q0, q0, [x0, 128] str d1, [x0, 160] ret ----- CUT ---- But d1 is the same as q0 really. And we don't need to have it.