diff options
author | Marek Polacek <polacek@redhat.com> | 2015-09-14 10:36:50 +0000 |
---|---|---|
committer | Marek Polacek <mpolacek@gcc.gnu.org> | 2015-09-14 10:36:50 +0000 |
commit | aa256c4aedce567eff0d5fdf7b2e4067bc9e3c42 (patch) | |
tree | 001e0f81efbd2a370e6d6c036da01bc1cd490e18 /gcc/c-family | |
parent | 0f876f22887f239cedca64ff170b71e5f1daaf54 (diff) | |
download | gcc-aa256c4aedce567eff0d5fdf7b2e4067bc9e3c42.zip gcc-aa256c4aedce567eff0d5fdf7b2e4067bc9e3c42.tar.gz gcc-aa256c4aedce567eff0d5fdf7b2e4067bc9e3c42.tar.bz2 |
c-common.c (warn_for_sign_compare): Cast to unsigned when shifting a negative value.
* c-common.c (warn_for_sign_compare): Cast to unsigned when shifting
a negative value.
* c-typeck.c (set_nonincremental_init_from_string): Use
HOST_WIDE_INT_M1U when shifting a negative value.
* rtlanal.c (split_double): Cast to unsigned when shifting a negative
value.
* sched-int.h (UNKNOWN_DEP_COST): Likewise.
From-SVN: r227743
Diffstat (limited to 'gcc/c-family')
-rw-r--r-- | gcc/c-family/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/c-family/c-common.c | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog index 0163b15..8f8de18 100644 --- a/gcc/c-family/ChangeLog +++ b/gcc/c-family/ChangeLog @@ -1,3 +1,8 @@ +2015-09-14 Marek Polacek <polacek@redhat.com> + + * c-common.c (warn_for_sign_compare): Cast to unsigned when shifting + a negative value. + 2015-09-11 Mark Wielaard <mjw@redhat.com> PR c/28901 diff --git a/gcc/c-family/c-common.c b/gcc/c-family/c-common.c index 9758b9e..4b922bf 100644 --- a/gcc/c-family/c-common.c +++ b/gcc/c-family/c-common.c @@ -12142,7 +12142,7 @@ warn_for_sign_compare (location_t location, if (bits < TYPE_PRECISION (result_type) && bits < HOST_BITS_PER_LONG && unsignedp) { - mask = (~ (HOST_WIDE_INT) 0) << bits; + mask = (~ (unsigned HOST_WIDE_INT) 0) << bits; if ((mask & constant) != mask) { if (constant == 0) |