summaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-math-opts.c
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2014-06-20 06:30:19 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2014-06-20 06:30:19 +0000
commit706fd3a42e80178029a9373679d203652f36147b (patch)
tree62c9e67f61bb42960cddae702071f0e081ea7958 /gcc/tree-ssa-math-opts.c
parentee204f6665c27c671355ba1bfd56d99dce562cbf (diff)
downloadgcc-706fd3a42e80178029a9373679d203652f36147b.tar.gz
* tree-ssa-math-opts.c (do_shift_rotate, find_bswap_or_nop_1): Cast
0xff to uint64_t before shifting it up. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@211837 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-math-opts.c')
-rw-r--r--gcc/tree-ssa-math-opts.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/gcc/tree-ssa-math-opts.c b/gcc/tree-ssa-math-opts.c
index 21345473e77..ca2b30dbc52 100644
--- a/gcc/tree-ssa-math-opts.c
+++ b/gcc/tree-ssa-math-opts.c
@@ -1669,7 +1669,8 @@ do_shift_rotate (enum tree_code code,
break;
case RSHIFT_EXPR:
/* Arithmetic shift of signed type: result is dependent on the value. */
- if (!TYPE_UNSIGNED (n->type) && (n->n & (0xff << (bitsize - 8))))
+ if (!TYPE_UNSIGNED (n->type)
+ && (n->n & ((uint64_t) 0xff << (bitsize - 8))))
return false;
n->n >>= count;
break;
@@ -1903,7 +1904,7 @@ find_bswap_or_nop_1 (gimple stmt, struct symbolic_number *n, int limit)
old_type_size = TYPE_PRECISION (n->type);
if (!TYPE_UNSIGNED (n->type)
&& type_size > old_type_size
- && n->n & (0xff << (old_type_size - 8)))
+ && n->n & ((uint64_t) 0xff << (old_type_size - 8)))
return NULL;
if (type_size / BITS_PER_UNIT < (int)(sizeof (int64_t)))