From: Richard Sandiford Date: Mon, 23 Oct 2017 06:07:26 +0000 (+0000) Subject: Fix HWI + -unsigned in combine.c X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=735d873d7b6d3310a96b548cdc2d61f236937e7f;p=gcc.git Fix HWI + -unsigned in combine.c rtx_equal_for_field_assignment_p had: x = adjust_address_nv (x, GET_MODE (y), -subreg_lowpart_offset (GET_MODE (x), GET_MODE (y))); But subreg_lowpart_offset returns an unsigned int and adjust_address_nv takes a HWI, so a subreg offset of 4 would give a memory offset of 0x00000000fffffffffc. 2017-10-23 Richard Sandiford gcc/ * combine.c (rtx_equal_for_field_assignment_p): Use byte_lowpart_offset. From-SVN: r253997 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 1bc0f001cc2..6caddb801b7 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2017-10-23 Richard Sandiford + + * combine.c (rtx_equal_for_field_assignment_p): Use + byte_lowpart_offset. + 2017-10-22 Richard Sandiford Alan Hayward David Sherwood diff --git a/gcc/combine.c b/gcc/combine.c index e5c276901d8..d71e50fdefb 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -9526,13 +9526,9 @@ rtx_equal_for_field_assignment_p (rtx x, rtx y, bool widen_x) return 0; if (BYTES_BIG_ENDIAN != WORDS_BIG_ENDIAN) return 0; - /* For big endian, adjust the memory offset. */ - if (BYTES_BIG_ENDIAN) - x = adjust_address_nv (x, GET_MODE (y), - -subreg_lowpart_offset (GET_MODE (x), - GET_MODE (y))); - else - x = adjust_address_nv (x, GET_MODE (y), 0); + x = adjust_address_nv (x, GET_MODE (y), + byte_lowpart_offset (GET_MODE (y), + GET_MODE (x))); } if (x == y || rtx_equal_p (x, y))