summaryrefslogtreecommitdiff
path: root/gcc/tree-dfa.h
diff options
context:
space:
mode:
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>2014-05-13 13:51:20 +0000
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>2014-05-13 13:51:20 +0000
commit012e5b9b070a59ab0db6e690f59a70e04f28daa5 (patch)
tree0847c4ecc1245bc64f72826d0d4d5e887cefd641 /gcc/tree-dfa.h
parentaab5ced339d675f53adfa2a4e966c91328d15190 (diff)
downloadgcc-012e5b9b070a59ab0db6e690f59a70e04f28daa5.tar.gz
gcc/
* tree-dfa.h (get_addr_base_and_unit_offset_1): Update array index calculation to match get_ref_base_and_extent. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@210377 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-dfa.h')
-rw-r--r--gcc/tree-dfa.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/tree-dfa.h b/gcc/tree-dfa.h
index 7b076c7f73f..fe135879074 100644
--- a/gcc/tree-dfa.h
+++ b/gcc/tree-dfa.h
@@ -103,7 +103,8 @@ get_addr_base_and_unit_offset_1 (tree exp, HOST_WIDE_INT *poffset,
TREE_CODE (unit_size) == INTEGER_CST))
{
offset_int woffset
- = offset_int::from (wi::sub (index, low_bound), SIGNED);
+ = wi::sext (wi::to_offset (index) - wi::to_offset (low_bound),
+ TYPE_PRECISION (TREE_TYPE (index)));
woffset *= wi::to_offset (unit_size);
byte_offset += woffset.to_shwi ();
}