This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug tree-optimization/32120] missed PRE/FRE of a*2+4 and (a+2)*2



------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]