From e3fe09c154f89ee0567b53b8e8e1e4d44c1e3de0 Mon Sep 17 00:00:00 2001 From: Uros Bizjak Date: Fri, 22 Jul 2016 16:09:55 +0200 Subject: [PATCH] c-typeck.c: Use HOST_WIDE_INT_1 instead of (HOST_WIDE_INT) 1, c/ChangeLog: * c-typeck.c: Use HOST_WIDE_INT_1 instead of (HOST_WIDE_INT) 1, c-family/ChangeLog: * c-common.c: Use HOST_WIDE_INT_M1U instead of ~(unsigned HOST_WIDE_INT) 0. From-SVN: r238643 --- gcc/c-family/ChangeLog | 5 +++++ gcc/c-family/c-common.c | 2 +- gcc/c/ChangeLog | 4 ++++ gcc/c/c-typeck.c | 4 ++-- 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog index ba6093af6f6..a2184ad6756 100644 --- a/gcc/c-family/ChangeLog +++ b/gcc/c-family/ChangeLog @@ -1,3 +1,8 @@ +2016-07-22 Uros Bizjak + + * c-common.c: Use HOST_WIDE_INT_M1U instead of + ~(unsigned HOST_WIDE_INT) 0. + 2016-07-22 Martin Liska PR gcov-profile/69028 diff --git a/gcc/c-family/c-common.c b/gcc/c-family/c-common.c index 9900e93ffc2..1cc61ee7e13 100644 --- a/gcc/c-family/c-common.c +++ b/gcc/c-family/c-common.c @@ -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) diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog index 397bbf8ad5b..b1c42ff4ca5 100644 --- a/gcc/c/ChangeLog +++ b/gcc/c/ChangeLog @@ -1,3 +1,7 @@ +2016-07-22 Uros Bizjak + + * c-typeck.c: Use HOST_WIDE_INT_1 instead of (HOST_WIDE_INT) 1, + 2016-07-20 David Malcolm * c-decl.c (struct edit_distance_traits): Move to diff --git a/gcc/c/c-typeck.c b/gcc/c/c-typeck.c index 0b5ab91d0d5..07e39ef04d1 100644 --- a/gcc/c/c-typeck.c +++ b/gcc/c/c-typeck.c @@ -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); } -- 2.30.2