aboutsummaryrefslogtreecommitdiff
path: root/gcc/fold-const.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2015-06-29 11:28:17 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2015-06-29 11:28:17 +0000
commit99e943a2be4bb7ec0d51b5a68e44d0d42dd9347a (patch)
treede2d1287b43d96691cfb42c5e3a59e13f9cf3696 /gcc/fold-const.c
parent2dcaddb8d74e3ec30edb264b845a346e0b7e9ab9 (diff)
downloadgcc-99e943a2be4bb7ec0d51b5a68e44d0d42dd9347a.zip
gcc-99e943a2be4bb7ec0d51b5a68e44d0d42dd9347a.tar.gz
gcc-99e943a2be4bb7ec0d51b5a68e44d0d42dd9347a.tar.bz2
genmatch.c (add_operator): Treat ADDR_EXPR as atom.
2015-06-29 Richard Biener <rguenther@suse.de> * genmatch.c (add_operator): Treat ADDR_EXPR as atom. * fold-const.c (fold_binary_loc): Move &A - &B simplification via ptr_difference_const ... * match.pd: ... here. When matching (X ^ Y) == Y also match with swapped operands. From-SVN: r225115
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r--gcc/fold-const.c10
1 files changed, 0 insertions, 10 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index 6f12dd0..7b9502e 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -10618,16 +10618,6 @@ fold_binary_loc (location_t loc,
fold_convert_loc (loc, type,
negate_expr (arg1)));
- /* Try folding difference of addresses. */
- {
- HOST_WIDE_INT diff;
-
- if ((TREE_CODE (arg0) == ADDR_EXPR
- || TREE_CODE (arg1) == ADDR_EXPR)
- && ptr_difference_const (arg0, arg1, &diff))
- return build_int_cst_type (type, diff);
- }
-
/* Fold &a[i] - &a[j] to i-j. */
if (TREE_CODE (arg0) == ADDR_EXPR
&& TREE_CODE (TREE_OPERAND (arg0, 0)) == ARRAY_REF