https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126465
--- Comment #9 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-16 branch has been updated by Tamar Christina <[email protected]>: https://gcc.gnu.org/g:7f89d4e2d6d84262001a9750e24cc896f9e8eb98 commit r16-9984-g7f89d4e2d6d84262001a9750e24cc896f9e8eb98 Author: Tamar Christina <[email protected]> Date: Wed Jul 29 14:16:52 2026 +0100 middle-end: fix COND_FMS foldings [PR126465] in r16-6508-g772b847d99d5e3 I made some typos 1. I forgot to negate the else value 2. one of the patterns was missing the mask. This fixes it. The patterns moving the COND inwards are still useful because they allow FMA forwarding as most micro-architectures don't forward FMA when there's a random instruction like fneg in between. Sorry for the mistakes. I added more tests to cover these now. gcc/ChangeLog: PR tree-optimization/126465 * match.pd: Fix FMS patterns. gcc/testsuite/ChangeLog: PR tree-optimization/126465 * gcc.target/aarch64/sve/cond_fma.c: New test. * gcc.target/aarch64/sve/cond_fma_neg_addend.c: New test. * gcc.target/aarch64/sve/cond_fms.c: New test. * gcc.target/aarch64/sve/cond_fnma.c: New test. * gcc.target/aarch64/sve/cond_fnms.c: New test. (cherry picked from commit e6e3290cddbf1da000bfc6fcd2a1e5a2b2cd27fb)
