[Bug middle-end/60962] b+(-2.f)*a generates multiplication instruction while b-2.f*a simplifies to addition&subtraction
rguenth at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Mon Sep 26 07:27:00 GMT 2016
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60962
--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
Of course the inconsistency with
/* 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...).
IMHO we should canonicalize here in some way and either always prefering
PLUS or positive constants should do the job. The code generation issue
is something for the RTL expander.
More information about the Gcc-bugs
mailing list