This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/32120] missed PRE/FRE of a*2+4 and (a+2)*2
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 29 Jun 2007 03:05:15 -0000
- Subject: [Bug tree-optimization/32120] missed PRE/FRE of a*2+4 and (a+2)*2
- References: <bug-32120-6528@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #4 from pinskia at gcc dot gnu dot org 2007-06-29 03:05 -------
Note we should also optimize:
int f(int a, int b)
{
int c = a+4;
int d = c*2;
int e = a*2;
int f = e+4;
return f+d;
}
into "a*2 + 12;" (or "(a+6)*2" ) so that only one mutliplication is there.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32120