aboutsummaryrefslogtreecommitdiff
path: root/gcc/match.pd
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/match.pd')
-rw-r--r--gcc/match.pd4
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/match.pd b/gcc/match.pd
index 84db1ee7360..9db48bda047 100644
--- a/gcc/match.pd
+++ b/gcc/match.pd
@@ -2456,9 +2456,13 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
(if (INTEGRAL_TYPE_P (type))
(mult @0 { build_int_cst (type, 2); }))))
+/* 0 - X -> -X. */
(simplify
(minus integer_zerop @1)
(negate @1))
+(simplify
+ (pointer_diff integer_zerop @1)
+ (negate (convert @1)))
/* (ARG0 - ARG1) is the same as (-ARG1 + ARG0). So check whether
ARG0 is zero and X + ARG0 reduces to X, since that would mean