projects
/
gcc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8f70460
)
Special case shifting by zero in operator_rshift::op1_range.
author
Aldy Hernandez
<aldyh@redhat.com>
Tue, 20 Oct 2020 06:53:21 +0000
(08:53 +0200)
committer
Aldy Hernandez
<aldyh@redhat.com>
Tue, 20 Oct 2020 08:33:48 +0000
(10:33 +0200)
gcc/ChangeLog:
* range-op.cc (operator_rshift::op1_range): Special case
shifting by zero.
gcc/range-op.cc
patch
|
blob
|
history
diff --git
a/gcc/range-op.cc
b/gcc/range-op.cc
index 21d98de2240621ed2ef2a6a534981b3b67703335..ee62f103598aff16549f45a0949be350f98f1848 100644
(file)
--- a/
gcc/range-op.cc
+++ b/
gcc/range-op.cc
@@
-1642,6
+1642,11
@@
operator_rshift::op1_range (irange &r,
wi::uhwi (prec, TYPE_PRECISION (TREE_TYPE (shift))),
UNSIGNED))
return false;
+ if (wi::to_wide (shift) == 0)
+ {
+ r = lhs;
+ return true;
+ }
// Folding the original operation may discard some impossible
// ranges from the LHS.