summaryrefslogtreecommitdiffstats
path: root/gcc
diff options
context:
space:
mode:
authorwilson <wilson@138bc75d-0d04-0410-961f-82ee72b054a4>2000-04-14 23:11:01 +0000
committerwilson <wilson@138bc75d-0d04-0410-961f-82ee72b054a4>2000-04-14 23:11:01 +0000
commitf8d937be1333d515ab4d305c316709c95c5f16a5 (patch)
treed2b85db3da8e452e68244bddadfb8efbf9ded3ff /gcc
parentb51fc4144b5e283f03618922cdf9acd169fac7a8 (diff)
downloadppe42-gcc-f8d937be1333d515ab4d305c316709c95c5f16a5.tar.gz
ppe42-gcc-f8d937be1333d515ab4d305c316709c95c5f16a5.zip
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@33157 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/combine.c7
2 files changed, 12 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 60fa2cc9798..ff72913193d 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 911ebbf8c9e..4bcaf388115 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),
OpenPOWER on IntegriCloud