aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-dfa.h
diff options
context:
space:
mode:
authorKenneth Zadeck <zadeck@naturalbridge.com>2014-05-06 16:25:05 +0000
committerMike Stump <mrs@gcc.gnu.org>2014-05-06 16:25:05 +0000
commit807e902eea17f3132488c256c963823976b2348c (patch)
treee5e1af94eb1502ba893bd6ce4a11f68877ff62a9 /gcc/tree-dfa.h
parent6122336c832dc4dfedc49279549caddce86306ff (diff)
downloadgcc-807e902eea17f3132488c256c963823976b2348c.zip
gcc-807e902eea17f3132488c256c963823976b2348c.tar.gz
gcc-807e902eea17f3132488c256c963823976b2348c.tar.bz2
Merge in wide-int.
From-SVN: r210113
Diffstat (limited to 'gcc/tree-dfa.h')
-rw-r--r--gcc/tree-dfa.h19
1 files changed, 8 insertions, 11 deletions
diff --git a/gcc/tree-dfa.h b/gcc/tree-dfa.h
index 86590ad..7b076c7 100644
--- a/gcc/tree-dfa.h
+++ b/gcc/tree-dfa.h
@@ -102,11 +102,10 @@ 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))
{
- 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 ();
+ offset_int woffset
+ = offset_int::from (wi::sub (index, low_bound), SIGNED);
+ woffset *= wi::to_offset (unit_size);
+ byte_offset += woffset.to_shwi ();
}
else
return NULL_TREE;
@@ -135,9 +134,8 @@ get_addr_base_and_unit_offset_1 (tree exp, HOST_WIDE_INT *poffset,
{
if (!integer_zerop (TREE_OPERAND (exp, 1)))
{
- double_int off = mem_ref_offset (exp);
- gcc_assert (off.high == -1 || off.high == 0);
- byte_offset += off.to_shwi ();
+ offset_int off = mem_ref_offset (exp);
+ byte_offset += off.to_short_addr ();
}
exp = TREE_OPERAND (base, 0);
}
@@ -158,9 +156,8 @@ get_addr_base_and_unit_offset_1 (tree exp, HOST_WIDE_INT *poffset,
return NULL_TREE;
if (!integer_zerop (TMR_OFFSET (exp)))
{
- double_int off = mem_ref_offset (exp);
- gcc_assert (off.high == -1 || off.high == 0);
- byte_offset += off.to_shwi ();
+ offset_int off = mem_ref_offset (exp);
+ byte_offset += off.to_short_addr ();
}
exp = TREE_OPERAND (base, 0);
}