From: Richard Sandiford Date: Tue, 13 May 2014 13:51:20 +0000 (+0000) Subject: tree-dfa.h (get_addr_base_and_unit_offset_1): Update array index calculation to match... X-Git-Tag: releases/gcc-5.1.0~7611 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=460d1e22353835f4cf8749aedd07387185146eb6;p=thirdparty%2Fgcc.git 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 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index f8481729212c..972a783b3a71 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2014-05-13 Richard Sandiford + + * 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 Sandra Loosemore diff --git a/gcc/tree-dfa.h b/gcc/tree-dfa.h index 7b076c7f73f4..fe1358790749 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 (); }