https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95845
Bug ID: 95845 Summary: Failure to optimize vector load made in separate operations to single load Product: gcc Version: 11.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: gabravier at gmail dot com Target Milestone: --- typedef float __attribute__((vector_size(8))) v2f32; v2f32 f(const float *ptr) { v2f32 r; r[0] = ptr[0]; r[1] = ptr[1]; return r; } This can be optimized to `return (v2f32){ptr[0], ptr[1]};`. This transformation is done by LLVM, but not by GCC.