[Bug tree-optimization/48092] associative property of builtins is not exploited on GIMPLE

vincenzo.innocente at cern dot ch gcc-bugzilla@gcc.gnu.org
Thu Sep 8 10:14:00 GMT 2011


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48092

--- Comment #3 from vincenzo Innocente <vincenzo.innocente at cern dot ch> 2011-09-08 10:01:48 UTC ---
btw even in C  with -Ofast
 a*exp(x)*exp(y) (same for sqrt) is NOT optimized. compare

double exp0(double x, double y) {
   return exp(x)*exp(y);
}

double exp1(double a, double x, double y) {
   return a*exp(x)*exp(y);
}

double exp02(double a, double x, double y) {
  return a*(exp(x)*exp(y));
}



More information about the Gcc-bugs mailing list