Testcase: #define vector __attribute__((vector_size(16) )) typedef vector int t;
t f(t a) { int b = *(int*)&a; return (vector int){b,b,b,b}; } ----------------- CUT -------- This should just produce : vspltw v2,v2,0 blr But right now we do: _f: addi r2,r1,-16 stvewx v2,0,r2 lvewx v2,0,r2 vspltw v2,v2,0 blr Which is not good at all, as it causes a load hit store hazzard to happen on the Cell and it also causes the dispatch group to be rejected for the power4/power5/970. This is related to PR 32107. -- Summary: vector "extract" and then vector "splat" is not optimized Product: gcc Version: 4.3.0 Status: UNCONFIRMED Keywords: missed-optimization Severity: normal Priority: P3 Component: target AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: pinskia at gcc dot gnu dot org GCC target triplet: powerpc*-*-* http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32110