From 735d873d7b6d3310a96b548cdc2d61f236937e7f Mon Sep 17 00:00:00 2001 From: Richard Sandiford Date: Mon, 23 Oct 2017 06:07:26 +0000 Subject: [PATCH] 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 --- gcc/ChangeLog | 5 +++++ gcc/combine.c | 10 +++------- 2 files changed, 8 insertions(+), 7 deletions(-) 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)) -- 2.30.2