diff options
author | Richard Biener <rguenther@suse.de> | 2014-11-07 09:00:32 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2014-11-07 09:00:32 +0000 |
commit | a499aac5dfa5d9be4945c162167d13cfc07b2a81 (patch) | |
tree | 696202c55daf649efb88070f8b62853e03d748c2 /gcc/fold-const.c | |
parent | a8cfbbdc7413f05278fa54d4c4644ec6eb5d943b (diff) | |
download | gcc-a499aac5dfa5d9be4945c162167d13cfc07b2a81.zip gcc-a499aac5dfa5d9be4945c162167d13cfc07b2a81.tar.gz gcc-a499aac5dfa5d9be4945c162167d13cfc07b2a81.tar.bz2 |
match.pd: Add patterns for POINTER_PLUS_EXPR association and special patterns from...
2014-11-07 Richard Biener <rguenther@suse.de>
* 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.
From-SVN: r217213
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r-- | gcc/fold-const.c | 17 |
1 files changed, 0 insertions, 17 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c index e3bb706..cff9c10 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, |