* combine.c (simplify_shift_const): Obey SHIFT_COUNT_TRUNCATED.
authorRichard Henderson <rth@cygnus.com>
Fri, 11 Aug 2000 07:38:23 +0000 (00:38 -0700)
committerRichard Henderson <rth@gcc.gnu.org>
Fri, 11 Aug 2000 07:38:23 +0000 (00:38 -0700)
From-SVN: r35622

gcc/ChangeLog
gcc/combine.c

index 2378838635305ec2f4a66ca9bcd7334f9bcdc212..0a72584d80273bf11a7699a19f0e0c4c56ac44df 100644 (file)
@@ -1,3 +1,7 @@
+2000-08-11  Richard Henderson  <rth@cygnus.com>
+
+       * combine.c (simplify_shift_const): Obey SHIFT_COUNT_TRUNCATED.
+
 Thu Aug 10 22:47:09 2000  Ovidiu Predescu  <ovidiu@cup.hp.com>
 
        * configure.in:
index e4243179bd19a6986e7304485fcc813626b381d5..4ad2f4f3b17d9ad2060cfed3b24e457e9d1db196 100644 (file)
@@ -8879,10 +8879,11 @@ simplify_shift_const (x, code, result_mode, varop, input_count)
           ? result_mode : mode);
 
       /* Handle cases where the count is greater than the size of the mode
-        minus 1.  For ASHIFT, use the size minus one as the count (this can
-        occur when simplifying (lshiftrt (ashiftrt ..))).  For rotates,
-        take the count modulo the size.  For other shifts, the result is
-        zero.
+        minus 1.  If SHIFT_COUNT_TRUNCATED, there aren't really any such
+        cases.  Otherwise, for ASHIFT, use the size minus one as the count
+        (this can occur when simplifying (lshiftrt (ashiftrt ..))).  For
+        rotates, take the count modulo the size.  For other shifts, the
+        result is zero.
 
         Since these shifts are being produced by the compiler by combining
         multiple operations, each of which are defined, we know what the
@@ -8890,6 +8891,11 @@ simplify_shift_const (x, code, result_mode, varop, input_count)
 
       if (count > GET_MODE_BITSIZE (shift_mode) - 1)
        {
+#ifdef SHIFT_COUNT_TRUNCATED
+         if (SHIFT_COUNT_TRUNCATED)
+           count %= GET_MODE_BITSIZE (shift_mode);
+         else
+#endif
          if (code == ASHIFTRT)
            count = GET_MODE_BITSIZE (shift_mode) - 1;
          else if (code == ROTATE || code == ROTATERT)