]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
tree-vrp.c (extract_range_from_binary_expr): Don't shift by floor_log2 of zero.
authorAlexandre Oliva <aoliva@redhat.com>
Fri, 12 Dec 2008 04:56:29 +0000 (04:56 +0000)
committerAlexandre Oliva <aoliva@gcc.gnu.org>
Fri, 12 Dec 2008 04:56:29 +0000 (04:56 +0000)
* tree-vrp.c (extract_range_from_binary_expr): Don't shift by
floor_log2 of zero.  Negate widened zero.

From-SVN: r142702

gcc/ChangeLog
gcc/tree-vrp.c

index 2736005bbfdccd052ba44c5483f97ed59be2db2b..6c9a378e78a3e59a2b9c241363372d1e6027fbec 100644 (file)
@@ -1,3 +1,8 @@
+2008-12-12  Alexandre Oliva  <aoliva@redhat.com>
+
+       * tree-vrp.c (extract_range_from_binary_expr): Don't shift by
+       floor_log2 of zero.  Negate widened zero.
+
 2008-12-12  Ben Elliston  <bje@au.ibm.com>
 
        * config/fp-bit.c (nan): Rename from this ..
index a69b216b796f28bddf63a857fa3a3b29d049e01b..9d23b24087f1d5acf7c28e9fe8558361d1778d8b 100644 (file)
@@ -2557,11 +2557,11 @@ extract_range_from_binary_expr (value_range_t *vr,
          ior_max.high = vr0_max.high | vr1_max.high;
          if (ior_max.high != 0)
            {
-             ior_max.low = ~0u;
+             ior_max.low = ~(unsigned HOST_WIDE_INT)0u;
              ior_max.high |= ((HOST_WIDE_INT) 1
                               << floor_log2 (ior_max.high)) - 1;
            }
-         else
+         else if (ior_max.low != 0)
            ior_max.low |= ((unsigned HOST_WIDE_INT) 1u
                            << floor_log2 (ior_max.low)) - 1;