[PATCH] Fix undefined behaviour in mips port
authorJeff Law <law@redhat.com>
Sat, 26 Sep 2015 07:38:29 +0000 (01:38 -0600)
committerJeff Law <law@gcc.gnu.org>
Sat, 26 Sep 2015 07:38:29 +0000 (01:38 -0600)
[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
gcc/config/mips/mips.c

index 98c1bd9c913e6e82a84ead36fa5b22870d15080b..6887b14fde3035288f290bd01a55b9dcd53ed161 100644 (file)
@@ -1,5 +1,8 @@
 2015-09-26  Jeff Law  <law@redhat.com>
 
+       * 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.
index 0e0ecf232d9b57724a801720f8cd6b44530abdd2..456db08d5f02dcb7955bb5b2f2236b7e2ad4f654 100644 (file)
@@ -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.  */