http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56339
Bug #: 56339 Summary: [4.8 Regression]: Suboptimal register allocation Classification: Unclassified Product: gcc Version: 4.8.0 Status: UNCONFIRMED Keywords: ra Severity: normal Priority: P3 Component: rtl-optimization AssignedTo: unassig...@gcc.gnu.org ReportedBy: ubiz...@gmail.com CC: vmaka...@gcc.gnu.org Split out from PR55941. The testcase from referred PR --cut here-- typedef struct A { double a, b; } A; double f(A x,double y){return x.a+y;} --cut here-- compiles to (-O2): f: addsd %xmm0, %xmm2 movapd %xmm2, %xmm0 ret gcc-4.7 generates: f: addsd %xmm2, %xmm0 ret LRA does not take into account commutative operands here.