This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/60962] b+(-2.f)*a generates multiplication instruction while b-2.f*a simplifies to addition&subtraction
- From: "joseph at codesourcery dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 27 Sep 2016 21:13:47 +0000
- Subject: [Bug middle-end/60962] b+(-2.f)*a generates multiplication instruction while b-2.f*a simplifies to addition&subtraction
- Auto-submitted: auto-generated
- References: <bug-60962-4@http.gcc.gnu.org/bugzilla/>
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.