From 770ae4bbe38a60a250f49e7ea5bf42bd37856313 Mon Sep 17 00:00:00 2001 From: rguenth Date: Fri, 7 Nov 2014 09:00:32 +0000 Subject: 2014-11-07 Richard Biener * match.pd: Add patterns for POINTER_PLUS_EXPR association and special patterns from tree-ssa-forwprop.c * fold-const.c (fold_binary_loc): Remove them here. * tree-ssa-forwprop.c (to_purge): New global bitmap. (fwprop_set_lattice_val): New function. (fwprop_invalidate_lattice): Likewise. (remove_prop_source_from_use): Instead of purging dead EH edges record blocks to do that in to_purge. (tidy_after_forward_propagate_addr): Likewise. (forward_propagate_addr_expr): Invalidate the lattice for SSA names we release. (simplify_conversion_from_bitmask): Likewise. (simplify_builtin_call): Likewise. (associate_pointerplus_align): Remove. (associate_pointerplus_diff): Likewise. (associate_pointerplus): Likewise. (fold_all_stmts): Merge with ... (pass_forwprop::execute): ... the original loop over all basic-blocks. Delay purging dead EH edges and invalidate the lattice for SSA names we release. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@217213 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/fold-const.c | 17 ----------------- 1 file changed, 17 deletions(-) (limited to 'gcc/fold-const.c') diff --git a/gcc/fold-const.c b/gcc/fold-const.c index e3bb70643d5..cff9c106f1e 100644 --- a/gcc/fold-const.c +++ b/gcc/fold-const.c @@ -10009,10 +10009,6 @@ fold_binary_loc (location_t loc, return NULL_TREE; case POINTER_PLUS_EXPR: - /* 0 +p index -> (type)index */ - if (integer_zerop (arg0)) - return non_lvalue_loc (loc, fold_convert_loc (loc, type, arg1)); - /* INT +p INT -> (PTR)(INT + INT). Stripping types allows for this. */ if (INTEGRAL_TYPE_P (TREE_TYPE (arg1)) && INTEGRAL_TYPE_P (TREE_TYPE (arg0))) @@ -10023,19 +10019,6 @@ fold_binary_loc (location_t loc, fold_convert_loc (loc, sizetype, arg0))); - /* (PTR +p B) +p A -> PTR +p (B + A) */ - if (TREE_CODE (arg0) == POINTER_PLUS_EXPR) - { - tree inner; - tree arg01 = fold_convert_loc (loc, sizetype, TREE_OPERAND (arg0, 1)); - tree arg00 = TREE_OPERAND (arg0, 0); - inner = fold_build2_loc (loc, PLUS_EXPR, sizetype, - arg01, fold_convert_loc (loc, sizetype, arg1)); - return fold_convert_loc (loc, type, - fold_build_pointer_plus_loc (loc, - arg00, inner)); - } - /* PTR_CST +p CST -> CST1 */ if (TREE_CODE (arg0) == INTEGER_CST && TREE_CODE (arg1) == INTEGER_CST) return fold_build2_loc (loc, PLUS_EXPR, type, arg0, -- cgit v1.2.1