summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoraoliva <aoliva@138bc75d-0d04-0410-961f-82ee72b054a4>2008-12-12 04:56:29 +0000
committeraoliva <aoliva@138bc75d-0d04-0410-961f-82ee72b054a4>2008-12-12 04:56:29 +0000
commitb126ad48b82fb94d4024b4b444267dd382f24774 (patch)
tree1ffb7ffff10a699fb7a8e87e1fd7bf924380fd57
parent657bf677e0316bbe385cc292a19ca29f1443bca3 (diff)
downloadgcc-b126ad48b82fb94d4024b4b444267dd382f24774.tar.gz
* tree-vrp.c (extract_range_from_binary_expr): Don't shift by
floor_log2 of zero. Negate widened zero. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@142702 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/tree-vrp.c4
2 files changed, 7 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 2736005bbfd..6c9a378e78a 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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 ..
diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c
index a69b216b796..9d23b24087f 100644
--- a/gcc/tree-vrp.c
+++ b/gcc/tree-vrp.c
@@ -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;