https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116979
--- Comment #37 from Alexander Monakov <amonakov at gcc dot gnu.org> ---
(In reply to Paul Caprioli from comment #36)
> Would you agree it's OK to use mul_fma for complex multiplication if
> -ffp-contract=on ?
Sorry, I will be cautious as long as it potentially introduces an internal
contradiction and affects results depending on optimization level. Perhaps, if
both -ffp-contract=on and -fcx-limited-range are specified, we can expand
complex multiplication to mul-fma early on, alleviating those concerns (only
non-commutativity would remain). [*]
And, as Richard suggested, we can introduce a new -f option to control how
complex multiplication is expanded.
[*] longer-term it may be possible to always expand complex multiplication
early, by modeling the nan-fixup step in straight-line code via a new internal
function, i.e. expand cr = cx * cx to scalar ops, then model the fixup as
{cr_real, cr_imag} = .IFN_CMUL_FIXUP(cr_real, cr_imag, cx, cy)
then expand the ifn to branchy code like we do in current complex lowering.