Just like PR 28367: #define vector __attribute__((vector_size(16))) float f(vector float t) { return *(float*)&t; }
We get a full vector store which we can get around with a stvewx which just stores that one element and we can get that via a vec_extract pattern. On x86_64 has the same issue, maybe even worse as there is no need to go through memory there. X86_64 produces: f: .LFB2: movaps %xmm0, -24(%rsp) movss -24(%rsp), %xmm0 ret When really it should produce just a ret. -- Summary: accessing an element via a "pointer" on a vector does not cause vec_extract to be used Product: gcc Version: 4.2.0 Status: UNCONFIRMED Keywords: missed-optimization Severity: normal Priority: P3 Component: middle-end AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: pinskia at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28436