[Bug tree-optimization/125431] [14/15/16/17 Regression] Generated complex-arithmetic code includes FCMLA instructions even when -ffp-contract=off

cvs-commit at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Jun 3 08:42:56 GMT 2026


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

--- Comment #4 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Tamar Christina <tnfchris@gcc.gnu.org>:

https://gcc.gnu.org/g:074ed30c2382f163b74e98baa4c242a721c57519

commit r17-1250-g074ed30c2382f163b74e98baa4c242a721c57519
Author: Tamar Christina <tamar.christina@arm.com>
Date:   Wed Jun 3 09:42:15 2026 +0100

    vect: gate COMPLEX_MUL on FP_CONTRACT_FAST [PR125431]

    The checks for FP_CONTRACT_FAST were in the wrong place for complex_mul.

    The location it was in would only block FMA but not MUL.  It would also not
    really reject the forming of the FMA, it would just create an invalid
collection
    of nodes which would fail analysis later on.

    However complex multiplication is also a contraction, since it's doing

    real = a*c - b*d
    imag = a*d + b*c

    This moves the checks up to earliest possible location and actually just
returns
    and adds the missing check for FMS.

    gcc/ChangeLog:

            PR tree-optimization/125431
            * tree-vect-slp-patterns.cc (complex_mul_pattern::matches,
            complex_fms_pattern::matches): Gate on FP contraction.

    gcc/testsuite/ChangeLog:

            PR tree-optimization/125431
            * gfortran.dg/vect/pr125431.f90: New test.


More information about the Gcc-bugs mailing list