[Bug middle-end/60962] b+(-2.f)*a generates multiplication instruction while b-2.f*a simplifies to addition&subtraction

joseph at codesourcery dot com gcc-bugzilla@gcc.gnu.org
Tue Sep 27 21:14:00 GMT 2016


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60962

--- Comment #3 from joseph at codesourcery dot com <joseph at codesourcery dot com> ---
On Mon, 26 Sep 2016, rguenth at gcc dot gnu.org wrote:

>       /* We want to canonicalize to positive real constants.  Pretend
>          that only negative ones can be easily negated.  */
> 
> is that we don't transform x + -2.*y to x - 2.*y (which in this case would
> also pessimize code, but well...).

Note that such a transformation is invalid if flag_rounding_math.


More information about the Gcc-bugs mailing list