diff options
author | Richard Guenther <rguenther@suse.de> | 2007-04-12 09:15:53 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2007-04-12 09:15:53 +0000 |
commit | 5852948c5b998dc8ddd9073ca68c097b96180838 (patch) | |
tree | 03bea213dba9cc1181e65e0dcad9f2ea2208af80 /gcc/gimplify.c | |
parent | d51347f96ce3765c6fad1c4e50c2b911e350339f (diff) | |
download | gcc-5852948c5b998dc8ddd9073ca68c097b96180838.zip gcc-5852948c5b998dc8ddd9073ca68c097b96180838.tar.gz gcc-5852948c5b998dc8ddd9073ca68c097b96180838.tar.bz2 |
re PR tree-optimization/24689 (operand_equal_p does not return true for some equivalent ARRAY_REF)
2007-04-12 Richard Guenther <rguenther@suse.de>
PR tree-optimization/24689
PR tree-optimization/31307
* fold-const.c (operand_equal_p): Compare INTEGER_CST array
indices by value.
* gimplify.c (canonicalize_addr_expr): To be consistent with
gimplify_compound_lval only set operands two and three of
ARRAY_REFs if they are not gimple_min_invariant. This makes
it never at this place.
* tree-ssa-ccp.c (maybe_fold_offset_to_array_ref): Likewise.
* g++.dg/tree-ssa/pr31307.C: New testcase.
* gcc.dg/tree-ssa/pr24689.c: Likewise.
From-SVN: r123736
Diffstat (limited to 'gcc/gimplify.c')
-rw-r--r-- | gcc/gimplify.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/gcc/gimplify.c b/gcc/gimplify.c index 8bedd86..0b6ec34 100644 --- a/gcc/gimplify.c +++ b/gcc/gimplify.c @@ -1607,9 +1607,7 @@ canonicalize_addr_expr (tree *expr_p) /* All checks succeeded. Build a new node to merge the cast. */ *expr_p = build4 (ARRAY_REF, dctype, obj_expr, TYPE_MIN_VALUE (TYPE_DOMAIN (datype)), - TYPE_MIN_VALUE (TYPE_DOMAIN (datype)), - size_binop (EXACT_DIV_EXPR, TYPE_SIZE_UNIT (dctype), - size_int (TYPE_ALIGN_UNIT (dctype)))); + NULL_TREE, NULL_TREE); *expr_p = build1 (ADDR_EXPR, ctype, *expr_p); } |