fold-const.c (make_range): When handling unsigned, don't reverse range if high bound...
authorRichard Kenner <kenner@vlsi1.ultra.nyu.edu>
Wed, 1 Oct 2003 20:48:57 +0000 (20:48 +0000)
committerRichard Kenner <kenner@gcc.gnu.org>
Wed, 1 Oct 2003 20:48:57 +0000 (16:48 -0400)
* fold-const.c (make_range): When handling unsigned, don't reverse
range if high bound is zero.

From-SVN: r71991

gcc/ChangeLog
gcc/fold-const.c

index 95052f222c0b5b03b58a7ff264a6283d4a9fb22e..c6ad7eb1b1cca42168063216417b5fdffe8ce76e 100644 (file)
@@ -1,3 +1,8 @@
+2003-10-01  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
+
+       * fold-const.c (make_range): When handling unsigned, don't reverse
+       range if high bound is zero.
+
 2003-09-30  Alexandre Oliva  <aoliva@redhat.com>
 
        config/frv/frv.h (PREDICATE_CODES): Added
index f5a6f78a14f618a76d9fe75f6be95ed2c97a6d9a..250d65930a86a2eae41d2e199169ae3e8fff6fa7 100644 (file)
@@ -3076,10 +3076,10 @@ make_range (tree exp, int *pin_p, tree *plow, tree *phigh)
 
              in_p = n_in_p, low = n_low, high = n_high;
 
-             /* If the high bound is missing, but we
-                have a low bound, reverse the range so
-                it goes from zero to the low bound minus 1.  */
-             if (high == 0 && low)
+             /* If the high bound is missing, but we have a non-zero low
+                bound, reverse the range so it goes from zero to the low bound
+                minus 1.  */
+             if (high == 0 && low && ! integer_zerop (low))
                {
                  in_p = ! in_p;
                  high = range_binop (MINUS_EXPR, NULL_TREE, low, 0,