[Bug tree-optimization/24964] Does not optimise abs(x)**2 to x**2

pinskia at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Mon Nov 21 00:40:00 GMT 2005



------- Comment #1 from pinskia at gcc dot gnu dot org  2005-11-21 00:40 -------
This comes down to the tree-combiner.
Take the following C functions:
double fabs(double);
double f(double a)
{
  return fabs(a)*fabs(a);
}

double f1(double *a)
{
  return fabs(*a)*fabs(*a);
}

double f2(double *a)
{
  double t = fabs(*a);
  return t*t;
}


Only f2 is not optimized.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  BugsThisDependsOn|                            |15459
             Status|UNCONFIRMED                 |NEW
          Component|fortran                     |tree-optimization
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2005-11-21 00:40:07
               date|                            |


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



More information about the Gcc-bugs mailing list