aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorKyrylo Tkachov <kyrylo.tkachov@arm.com>2015-07-21 08:26:32 +0000
committerKyrylo Tkachov <ktkachov@gcc.gnu.org>2015-07-21 08:26:32 +0000
commite4e96a4f372d721bf099e5169ca3b5342bc0f9e1 (patch)
treefb536232177bed1a7dff4951d7fa4ade6cacfb0a /gcc
parent2ac74346d8e946ed0460347839fdb465fd9814e4 (diff)
downloadgcc-e4e96a4f372d721bf099e5169ca3b5342bc0f9e1.zip
gcc-e4e96a4f372d721bf099e5169ca3b5342bc0f9e1.tar.gz
gcc-e4e96a4f372d721bf099e5169ca3b5342bc0f9e1.tar.bz2
[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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/match.pd4
2 files changed, 8 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 58a2233..4ede939 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2015-07-21 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
+
+ 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 <dj@redhat.com>
* config/rl78/rl78-real.md (andqi3_real): Expand operands for clr1.
diff --git a/gcc/match.pd b/gcc/match.pd
index 700a692..4226fb1 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.