http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16157
--- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> 2012-03-04 00:06:13 UTC --- If we rewrite the code to be: extern int a0, a1, a2, a3, a4; extern int b0, b1, b2, b3, b4; void f () { /* this can be optimized to four additions... */ b4 = a4 + (a3 + (a2 + (a1 + a0))); b3 = a3 + (a2 + (a1 + a0)); b2 = a2 + (a1 + a0); b1 = a1 + a0; } Then it gets optimized.