From: James E. Wilson Date: Thu, 30 Apr 2009 00:58:10 +0000 (+0000) Subject: mips.c (mips_add_offset): Use gen_int_mode for CONST_HIGH_PART result. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6d8f135b27947caf8e4dbdcaf050f2ae0b9957e1;p=gcc.git mips.c (mips_add_offset): Use gen_int_mode for CONST_HIGH_PART result. * config/mips/mips.c (mips_add_offset): Use gen_int_mode for CONST_HIGH_PART result. From-SVN: r146995 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 51d9ec989c4..c2943a6c3a0 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 29ae1795a5e..8dfd3c2e9fa 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);