From ddec87d98d27536e70f3b7ddbe6a85cd0422cc86 Mon Sep 17 00:00:00 2001 From: Jeff Law Date: Sat, 26 Sep 2015 01:38:29 -0600 Subject: [PATCH] [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 --- gcc/ChangeLog | 3 +++ gcc/config/mips/mips.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) 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. */ -- 2.30.2