aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2024-10-14 08:11:22 +0200
committerRichard Biener <rguenth@gcc.gnu.org>2024-10-14 09:50:20 +0200
commitc53bd48c6920bc1f4039b6682aafbf414a600e47 (patch)
treefbbd5e8730f8c86b40c0a2beb4d0204d47c0cda0
parent4d8373f853269cd3a6f99ad0cb774fccd68cb874 (diff)
downloadgcc-c53bd48c6920bc1f4039b6682aafbf414a600e47.zip
gcc-c53bd48c6920bc1f4039b6682aafbf414a600e47.tar.gz
gcc-c53bd48c6920bc1f4039b6682aafbf414a600e47.tar.bz2
middle-end/116891 - fix (negate (IFN_FNMS@3 @0 @1 @2)) -> (IFN_FMA @0 @1 @2)
Transforming -fma (-a, b, -c) to fma (a, b, c) is only valid when not rounding towards -inf or +inf as the sign of the multiplication changes. PR middle-end/116891 * match.pd ((negate (IFN_FNMS@3 @0 @1 @2)) -> (IFN_FMA @0 @1 @2)): Only enable for !HONOR_SIGN_DEPENDENT_ROUNDING.
-rw-r--r--gcc/match.pd2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/match.pd b/gcc/match.pd
index 2814618..ee53c25 100644
--- a/gcc/match.pd
+++ b/gcc/match.pd
@@ -9494,7 +9494,7 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
(IFN_FMA @0 @1 @2))
(simplify
(negate (IFN_FNMS@3 @0 @1 @2))
- (if (single_use (@3))
+ (if (!HONOR_SIGN_DEPENDENT_ROUNDING (type) && single_use (@3))
(IFN_FMA @0 @1 @2))))
/* CLZ simplifications. */