Another instance of left shifting a negative value. Fixed in an obvious way. Verified all the mips configurations in config-list.mk build now using a trunk compiler.

Installed on the trunk,
Jeff

commit fff8087106b686a8c0ac6c7dab3dd7e12cd717ba
Author: Jeff Law <l...@tor.usersys.redhat.com>
Date:   Sat Sep 26 03:24:00 2015 -0400

    [PATCH] Fix undefined behaviour in mips port
        * config/mips/mips.c (mips_compute_frame_info): Fix left shift
        undefined behaviour.

diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 98c1bd9..6887b14 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,8 @@
 2015-09-26  Jeff Law  <l...@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.
diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c
index 0e0ecf2..456db08 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.  */

Reply via email to