combine.c (simplify_shift_const): Bound shift count when combining shifts.
authorRichard Henderson <rth@cygnus.com>
Wed, 16 Aug 2000 06:22:20 +0000 (23:22 -0700)
committerRichard Henderson <rth@gcc.gnu.org>
Wed, 16 Aug 2000 06:22:20 +0000 (23:22 -0700)
        * combine.c (simplify_shift_const): Bound shift count when
        combining shifts.

From-SVN: r35739

gcc/ChangeLog
gcc/combine.c

index 1a08964..40df92a 100644 (file)
@@ -1,3 +1,8 @@
+2000-08-15  Richard Henderson  <rth@cygnus.com>
+
+       * combine.c (simplify_shift_const): Bound shift count when
+       combining shifts.
+
 Tue Aug 15 17:33:05 2000  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
 
        * calls.c (ECF_SP_DEPRESSED): New macro.
index 4ad2f4f..e4be714 100644 (file)
@@ -9149,6 +9149,8 @@ simplify_shift_const (x, code, result_mode, varop, input_count)
                    break;
 
                  count += first_count;
+                 if (count >= GET_MODE_BITSIZE (shift_mode))
+                   count = GET_MODE_BITSIZE (shift_mode) - 1;
                  varop = XEXP (varop, 0);
                  continue;
                }
@@ -9202,6 +9204,9 @@ simplify_shift_const (x, code, result_mode, varop, input_count)
              else
                count = signed_count;
 
+             if (count >= GET_MODE_BITSIZE (shift_mode))
+               count = GET_MODE_BITSIZE (shift_mode) - 1;
+
              varop = XEXP (varop, 0);
              continue;
            }