[Bug tree-optimization/125431] [14/15/16 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
Fri Jun 5 09:58:48 GMT 2026


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

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

https://gcc.gnu.org/g:56d14d7653e80e865b8e57592978510253bad522

commit r15-11261-g56d14d7653e80e865b8e57592978510253bad522
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.

    (cherry picked from commit 074ed30c2382f163b74e98baa4c242a721c57519)


More information about the Gcc-bugs mailing list