tree-dfa.h (get_addr_base_and_unit_offset_1): Update array index calculation to match get_ref_base_and_extent.

gcc/
	* tree-dfa.h (get_addr_base_and_unit_offset_1): Update array index
	calculation to match get_ref_base_and_extent.

From-SVN: r210377
This commit is contained in:
Richard Sandiford 2014-05-13 13:51:20 +00:00 committed by Richard Sandiford
parent 1e1f96b5f6
commit 460d1e2235
2 changed files with 7 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2014-05-13 Richard Sandiford <r.sandiford@uk.ibm.com>
* tree-dfa.h (get_addr_base_and_unit_offset_1): Update array index
calculation to match get_ref_base_and_extent.
2014-05-13 Catherine Moore <clm@codesourcery.com>
Sandra Loosemore <sandra@codesourcery.com>

View File

@ -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 ();
}