diff options
author | Jim Wilson <wilson@cygnus.com> | 2000-04-14 23:11:01 +0000 |
---|---|---|
committer | Jim Wilson <wilson@gcc.gnu.org> | 2000-04-14 16:11:01 -0700 |
commit | cfff35c1e538a08d1ef67506e934da0be62b338d (patch) | |
tree | d2b85db3da8e452e68244bddadfb8efbf9ded3ff | |
parent | 4c1545e441c284dab059b8d6d769d4b75e9cdf96 (diff) | |
download | gcc-cfff35c1e538a08d1ef67506e934da0be62b338d.zip gcc-cfff35c1e538a08d1ef67506e934da0be62b338d.tar.gz gcc-cfff35c1e538a08d1ef67506e934da0be62b338d.tar.bz2 |
Fix ia64 gdb miscompilation reported by Kevin Buettner.
* combine.c (force_to_mode, case LSHIFTRT): Check that shift shift
plus mask size is smaller or equal to the mode size.
From-SVN: r33157
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/combine.c | 7 |
2 files changed, 12 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 60fa2cc..ff72913 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +Fri Apr 14 16:09:02 2000 Jim Wilson <wilson@cygnus.com> + + * combine.c (force_to_mode, case LSHIFTRT): Check that shift shift + plus mask size is smaller or equal to the mode size. + Fri Apr 14 18:07:30 2000 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> * print-rtl.c (print_rtx, case NOTE): Don't blow up if NOTE_BASIC_BLOCK diff --git a/gcc/combine.c b/gcc/combine.c index 911ebbf..4bcaf38 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -6935,10 +6935,17 @@ force_to_mode (x, mode, mask, reg, just_select) if (GET_CODE (x) == LSHIFTRT && GET_CODE (XEXP (x, 1)) == CONST_INT + /* The shift puts one of the sign bit copies in the least significant + bit. */ && ((INTVAL (XEXP (x, 1)) + num_sign_bit_copies (XEXP (x, 0), GET_MODE (XEXP (x, 0)))) >= GET_MODE_BITSIZE (GET_MODE (x))) && exact_log2 (mask + 1) >= 0 + /* Number of bits left after the shift must be more than the mask + needs. */ + && ((INTVAL (XEXP (x, 1)) + exact_log2 (mask + 1)) + <= GET_MODE_BITSIZE (GET_MODE (x))) + /* Must be more sign bit copies than the mask needs. */ && ((int) num_sign_bit_copies (XEXP (x, 0), GET_MODE (XEXP (x, 0))) >= exact_log2 (mask + 1))) x = gen_binary (LSHIFTRT, GET_MODE (x), XEXP (x, 0), |