From: wilson Date: Thu, 30 Apr 2009 00:58:10 +0000 (+0000) Subject: * config/mips/mips.c (mips_add_offset): Use gen_int_mode for X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c8b71b5dce0f0bca6b87c88125de5860ffbf5aac;p=thirdparty%2Fgcc.git * config/mips/mips.c (mips_add_offset): Use gen_int_mode for CONST_HIGH_PART result. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@146995 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 51d9ec989c4e..c2943a6c3a0f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2009-04-29 James E. Wilson + + * config/mips/mips.c (mips_add_offset): Use gen_int_mode for + CONST_HIGH_PART result. + 2009-04-29 Anatoly Sokolov * config/avr/avr.c (initial_elimination_offset): Rename to diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c index 29ae1795a5e4..8dfd3c2e9fa2 100644 --- a/gcc/config/mips/mips.c +++ b/gcc/config/mips/mips.c @@ -2703,8 +2703,10 @@ mips_add_offset (rtx temp, rtx reg, HOST_WIDE_INT offset) } else { - /* Leave OFFSET as a 16-bit offset and put the excess in HIGH. */ - high = GEN_INT (CONST_HIGH_PART (offset)); + /* Leave OFFSET as a 16-bit offset and put the excess in HIGH. + The addition inside the macro CONST_HIGH_PART may cause an + overflow, so we need to force a sign-extension check. */ + high = gen_int_mode (CONST_HIGH_PART (offset), Pmode); offset = CONST_LOW_PART (offset); } high = mips_force_temporary (temp, high);