diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2013-12-02 11:20:14 +0000 |
---|---|---|
committer | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2013-12-02 11:20:14 +0000 |
commit | 139bd704f15614f21dc1113235cc5bd2dd81238f (patch) | |
tree | 8996b3856e8b5fe78d5f8abc322cbffb9f59af6c /gcc/tree-dfa.h | |
parent | 95044b50b030259b37c187862dca756ea58ef08a (diff) | |
download | gcc-139bd704f15614f21dc1113235cc5bd2dd81238f.zip gcc-139bd704f15614f21dc1113235cc5bd2dd81238f.tar.gz gcc-139bd704f15614f21dc1113235cc5bd2dd81238f.tar.bz2 |
re PR tree-optimization/59356 (ACATS C52102A and C52102C failures)
PR tree-optimization/59356
* tree-dfa.h (get_addr_base_and_unit_offset_1) <case ARRAY_REF>: Do the
offset computation using the precision of the index type.
From-SVN: r205585
Diffstat (limited to 'gcc/tree-dfa.h')
-rw-r--r-- | gcc/tree-dfa.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/gcc/tree-dfa.h b/gcc/tree-dfa.h index 7d0a470..71f2c21 100644 --- a/gcc/tree-dfa.h +++ b/gcc/tree-dfa.h @@ -102,11 +102,11 @@ get_addr_base_and_unit_offset_1 (tree exp, HOST_WIDE_INT *poffset, && (unit_size = array_ref_element_size (exp), TREE_CODE (unit_size) == INTEGER_CST)) { - HOST_WIDE_INT hindex = TREE_INT_CST_LOW (index); - - hindex -= TREE_INT_CST_LOW (low_bound); - hindex *= TREE_INT_CST_LOW (unit_size); - byte_offset += hindex; + double_int doffset + = (TREE_INT_CST (index) - TREE_INT_CST (low_bound)) + .sext (TYPE_PRECISION (TREE_TYPE (index))); + doffset *= tree_to_double_int (unit_size); + byte_offset += doffset.to_shwi (); } else return NULL_TREE; |