c/ChangeLog: 2016-07-22 Uros Bizjak <ubiz...@gmail.com>
* c-typeck.c: Use HOST_WIDE_INT_1 instead of (HOST_WIDE_INT) 1, c-family/ChangeLog: 2016-07-22 Uros Bizjak <ubiz...@gmail.com> * c-common.c: Use HOST_WIDE_INT_M1U instead of ~(unsigned HOST_WIDE_INT) 0. Bootstrapped and regression tested on x86_64-linux-gnu, committed to mainline SVN. Uros.
Index: gcc/c/c-typeck.c =================================================================== --- gcc/c/c-typeck.c (revision 238642) +++ gcc/c/c-typeck.c (working copy) @@ -8594,7 +8594,7 @@ set_nonincremental_init_from_string (tree str, bitpos = ((wchar_bytes - 1) * charwidth) + HOST_BITS_PER_CHAR; if (bitpos < HOST_BITS_PER_WIDE_INT) { - if (val[0] & (((HOST_WIDE_INT) 1) << (bitpos - 1))) + if (val[0] & (HOST_WIDE_INT_1 << (bitpos - 1))) { val[0] |= HOST_WIDE_INT_M1U << bitpos; val[1] = -1; @@ -8605,7 +8605,7 @@ set_nonincremental_init_from_string (tree str, if (val[0] < 0) val[1] = -1; } - else if (val[1] & (((HOST_WIDE_INT) 1) + else if (val[1] & (HOST_WIDE_INT_1 << (bitpos - 1 - HOST_BITS_PER_WIDE_INT))) val[1] |= HOST_WIDE_INT_M1U << (bitpos - HOST_BITS_PER_WIDE_INT); } Index: gcc/c-family/c-common.c =================================================================== --- gcc/c-family/c-common.c (revision 238642) +++ gcc/c-family/c-common.c (working copy) @@ -11999,7 +11999,7 @@ warn_for_sign_compare (location_t location, if (bits < TYPE_PRECISION (result_type) && bits < HOST_BITS_PER_LONG && unsignedp) { - mask = (~ (unsigned HOST_WIDE_INT) 0) << bits; + mask = HOST_WIDE_INT_M1U << bits; if ((mask & constant) != mask) { if (constant == 0)