aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJames E. Wilson <wilson@codesourcery.com>2009-04-30 00:58:10 +0000
committerJim Wilson <wilson@gcc.gnu.org>2009-04-29 17:58:10 -0700
commit6d8f135b27947caf8e4dbdcaf050f2ae0b9957e1 (patch)
tree0361f3fcb99090bde9dffec23918b479be8e5e50 /gcc
parent90adb9cbe75597b1372161c93d511774e4abd3bb (diff)
downloadgcc-6d8f135b27947caf8e4dbdcaf050f2ae0b9957e1.zip
gcc-6d8f135b27947caf8e4dbdcaf050f2ae0b9957e1.tar.gz
gcc-6d8f135b27947caf8e4dbdcaf050f2ae0b9957e1.tar.bz2
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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/config/mips/mips.c6
2 files changed, 9 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 51d9ec9..c2943a6 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2009-04-29 James E. Wilson <wilson@codesourcery.com>
+
+ * config/mips/mips.c (mips_add_offset): Use gen_int_mode for
+ CONST_HIGH_PART result.
+
2009-04-29 Anatoly Sokolov <aesok@post.ru>
* config/avr/avr.c (initial_elimination_offset): Rename to
diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c
index 29ae179..8dfd3c2 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);