aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-pre.c
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2011-03-31 20:52:41 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2011-03-31 20:52:41 +0000
commitd4d73ce26b36bdf1b061ab0297ed7d613afec9c5 (patch)
treed430c1e0cfadd9de02789a9bea82ab916411352a /gcc/tree-ssa-pre.c
parent35ca26acc659500991b2119a0b6d9526605ca168 (diff)
downloadgcc-d4d73ce26b36bdf1b061ab0297ed7d613afec9c5.zip
gcc-d4d73ce26b36bdf1b061ab0297ed7d613afec9c5.tar.gz
gcc-d4d73ce26b36bdf1b061ab0297ed7d613afec9c5.tar.bz2
tree-ssa-pre.c (create_component_ref_by_pieces_1): Drop a zero minimum index only if it is redundant.
* tree-ssa-pre.c (create_component_ref_by_pieces_1) <ARRAY_REF>: Drop a zero minimum index only if it is redundant. From-SVN: r171800
Diffstat (limited to 'gcc/tree-ssa-pre.c')
-rw-r--r--gcc/tree-ssa-pre.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/gcc/tree-ssa-pre.c b/gcc/tree-ssa-pre.c
index 0a6fa94..e59a598 100644
--- a/gcc/tree-ssa-pre.c
+++ b/gcc/tree-ssa-pre.c
@@ -2874,8 +2874,11 @@ create_component_ref_by_pieces_1 (basic_block block, vn_reference_t ref,
return NULL_TREE;
if (genop2)
{
- /* Drop zero minimum index. */
- if (tree_int_cst_equal (genop2, integer_zero_node))
+ tree domain_type = TYPE_DOMAIN (TREE_TYPE (genop0));
+ /* Drop zero minimum index if redundant. */
+ if (integer_zerop (genop2)
+ && (!domain_type
+ || integer_zerop (TYPE_MIN_VALUE (domain_type))))
genop2 = NULL_TREE;
else
{