[Bug tree-optimization/32183] -fast-math causes a missed optimization to happen
hjl at lucon dot org
gcc-bugzilla@gcc.gnu.org
Sat Jun 2 00:11:00 GMT 2007
------- Comment #5 from hjl at lucon dot org 2007-06-02 00:10 -------
(In reply to comment #3)
> (In reply to comment #2)
> > Is that OK to transform
> >
> > float sf;
> > ...
> > sf = 500 * sf;
> > for (i = 0; i < ceplen; i++)
> > sum[i] *= sf;
> >
> > to
> >
> > for (i = 0; i < ceplen; i++)
> > sum[i] = (sum[i]* 500)*sf;
> >
> > You can certainly get the different results when sf is small and sum[i] is
> > large.
>
> with -ffast-math, this transformation is ok (although it does not seem to make
> sense to do it, it moves a multiplication into a loop).
>
We moved a multiply, which is outside of loop in source, into
a loop. I don't think gcc should do it with any optimization
flag, including -ffast-math.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32183
More information about the Gcc-bugs
mailing list