[Bug tree-optimization/16157] gcc fails to optimize redundant expression (reassocation)
pinskia at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Sun Mar 4 00:06:00 GMT 2012
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.
More information about the Gcc-bugs
mailing list