From a0a65802bf1336dcaf72b060bc8a8decf228945a Mon Sep 17 00:00:00 2001 From: Jeff Law Date: Sat, 26 Sep 2015 01:42:32 -0600 Subject: [PATCH] [PATCH] Fix undefined behaviour in SH port [PATCH] Fix undefined behaviour in SH port * config/sh/sh.h (CONST_OK_FOR_J16): Fix left shift undefined behaviour From-SVN: r228165 --- gcc/ChangeLog | 3 +++ gcc/config/sh/sh.h | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6887b14fde3..28c6bf7fcc9 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,8 @@ 2015-09-26 Jeff Law + * config/sh/sh.h (CONST_OK_FOR_J16): Fix left shift undefined + behaviour + * config/mips/mips.c (mips_compute_frame_info): Fix left shift undefined behaviour. diff --git a/gcc/config/sh/sh.h b/gcc/config/sh/sh.h index 7aa489d6dc0..b18cc1fedc1 100644 --- a/gcc/config/sh/sh.h +++ b/gcc/config/sh/sh.h @@ -1176,7 +1176,7 @@ extern enum reg_class regno_reg_class[FIRST_PSEUDO_REGISTER]; #define CONST_OK_FOR_J16(VALUE) \ ((HOST_BITS_PER_WIDE_INT >= 64 && (VALUE) == (HOST_WIDE_INT) 0xffffffff) \ - || (HOST_BITS_PER_WIDE_INT >= 64 && (VALUE) == (HOST_WIDE_INT) -1 << 32)) + || (HOST_BITS_PER_WIDE_INT >= 64 && (VALUE) == (HOST_WIDE_INT) (HOST_WIDE_INT_M1U << 32))) #define CONST_OK_FOR_K08(VALUE) (((HOST_WIDE_INT)(VALUE))>= 0 \ && ((HOST_WIDE_INT)(VALUE)) <= 255) -- 2.30.2