https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84114
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |missed-optimization
Target| |aarch64, x86_64-*-*
Status|UNCONFIRMED |NEW
Last reconfirmed| |2018-01-30
Version|unknown |8.0
Ever confirmed|0 |1
--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
This is probably related to targetm.sched.reassociation_width where reassoc
will widen a PLUS chain so several instructions will be executable in parallel
without dependences. Thus, (x + (y + (z + w))) -> (x + y) + (z + w). When
all of them are fed by multiplications this goes from four fmas to two.
It's basically a target request we honor so it works as designed.
At some point I thought about integrating FMA detection with reassociation.