diff options
author | Jakub Jelinek <jakub@redhat.com> | 2014-06-20 08:30:19 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2014-06-20 08:30:19 +0200 |
commit | 88f5cfcd2bdc48b3def09453babc02d2821f9a60 (patch) | |
tree | 62c9e67f61bb42960cddae702071f0e081ea7958 | |
parent | 6d45574aa297574840e7b0d4ab3ec13f7d9d5b64 (diff) | |
download | gcc-88f5cfcd2bdc48b3def09453babc02d2821f9a60.zip gcc-88f5cfcd2bdc48b3def09453babc02d2821f9a60.tar.gz gcc-88f5cfcd2bdc48b3def09453babc02d2821f9a60.tar.bz2 |
tree-ssa-math-opts.c (do_shift_rotate, [...]): Cast 0xff to uint64_t before shifting it up.
* tree-ssa-math-opts.c (do_shift_rotate, find_bswap_or_nop_1): Cast
0xff to uint64_t before shifting it up.
From-SVN: r211837
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/tree-ssa-math-opts.c | 5 |
2 files changed, 8 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 03ce0d2..357596f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2014-06-20 Jakub Jelinek <jakub@redhat.com> + + * tree-ssa-math-opts.c (do_shift_rotate, find_bswap_or_nop_1): Cast + 0xff to uint64_t before shifting it up. + 2014-06-20 Julian Brown <julian@codesourcery.com> Chung-Lin Tang <cltang@codesourcery.com> diff --git a/gcc/tree-ssa-math-opts.c b/gcc/tree-ssa-math-opts.c index 2134547..ca2b30d 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))) |