From e4e96a4f372d721bf099e5169ca3b5342bc0f9e1 Mon Sep 17 00:00:00 2001 From: Kyrylo Tkachov Date: Tue, 21 Jul 2015 08:26:32 +0000 Subject: [PATCH] [match.pd] PR middle-end/66915 Restrict A - B -> A + (-B) to non-fixed-point types PR middle-end/66915 * match.pd (A - B -> A + (-B)): Don't allow folding when type if a fixed-point type. From-SVN: r226028 --- gcc/ChangeLog | 6 ++++++ gcc/match.pd | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 58a2233297b..4ede93948c4 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2015-07-21 Kyrylo Tkachov + + PR middle-end/66915 + * match.pd (A - B -> A + (-B)): Don't allow folding + when type if a fixed-point type. + 2015-07-20 DJ Delorie * config/rl78/rl78-real.md (andqi3_real): Expand operands for clr1. diff --git a/gcc/match.pd b/gcc/match.pd index 700a6922295..4226fb16c36 100644 --- a/gcc/match.pd +++ b/gcc/match.pd @@ -510,8 +510,8 @@ along with GCC; see the file COPYING3. If not see /* A - B -> A + (-B) if B is easily negatable. */ (simplify (minus @0 negate_expr_p@1) - (plus @0 (negate @1))) - + (if (!FIXED_POINT_TYPE_P (type)) + (plus @0 (negate @1)))) /* Try to fold (type) X op CST -> (type) (X op ((type-x) CST)) when profitable. -- 2.30.2