From: Jeff Law Date: Sat, 26 Sep 2015 07:38:29 +0000 (-0600) Subject: [PATCH] Fix undefined behaviour in mips port X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ddec87d98d27536e70f3b7ddbe6a85cd0422cc86;p=gcc.git [PATCH] Fix undefined behaviour in mips port [PATCH] Fix undefined behaviour in mips port * config/mips/mips.c (mips_compute_frame_info): Fix left shift undefined behaviour. From-SVN: r228164 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 98c1bd9c913..6887b14fde3 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,8 @@ 2015-09-26 Jeff Law + * config/mips/mips.c (mips_compute_frame_info): Fix left shift + undefined behaviour. + * config/cris/cris.md (asrandb): Fix left shift undefined behaviour. (asrandw): Likewise. diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c index 0e0ecf232d9..456db08d5f0 100644 --- a/gcc/config/mips/mips.c +++ b/gcc/config/mips/mips.c @@ -10572,7 +10572,7 @@ mips_compute_frame_info (void) if (mips_save_reg_p (regno)) { frame->num_fp += MAX_FPRS_PER_FMT; - frame->fmask |= ~(~0 << MAX_FPRS_PER_FMT) << (regno - FP_REG_FIRST); + frame->fmask |= ~(~0U << MAX_FPRS_PER_FMT) << (regno - FP_REG_FIRST); } /* Move above the FPR save area. */