]> gcc.gnu.org Git - gcc.git/commitdiff
tree-ssa-math-opts.c (do_shift_rotate, [...]): Cast 0xff to uint64_t before shifting...
authorJakub Jelinek <jakub@redhat.com>
Fri, 20 Jun 2014 06:30:19 +0000 (08:30 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Fri, 20 Jun 2014 06:30:19 +0000 (08:30 +0200)
* 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

gcc/ChangeLog
gcc/tree-ssa-math-opts.c

index 03ce0d2b3cc76f6c9ba32370f53fa7ae2f1f876c..357596f82513cce6631c5f12526cfc4fb81c9f96 100644 (file)
@@ -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>
 
index 21345473e774c61a1bc058a5cd2bee3ad2a40340..ca2b30dbc520f54dc7710c42a046762a0d4bf28f 100644 (file)
@@ -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)))
This page took 0.123049 seconds and 5 git commands to generate.