[ARM] Fix arm bootstrap failure due to -Werror=shift-negative-value
authorktkachov <ktkachov@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 15 Sep 2015 15:03:23 +0000 (15:03 +0000)
committerktkachov <ktkachov@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 15 Sep 2015 15:03:23 +0000 (15:03 +0000)
* config/arm/arm.c (arm_gen_constant): Use HOST_WIDE_INT_M1U instead
of -1 when shifting.  Change type of val to unsigned HOST_WIDE_INT.
Update prototype.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@227798 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config/arm/arm.c

index bc00735..6f60273 100644 (file)
@@ -1,3 +1,9 @@
+2015-09-15  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>
+
+       * config/arm/arm.c (arm_gen_constant): Use HOST_WIDE_INT_M1U instead
+       of -1 when shifting.  Change type of val to unsigned HOST_WIDE_INT.
+       Update prototype.
+
 2015-09-15  Richard Biener  <rguenther@suse.de>
 
        PR tree-optimization/67470
index e5d1a45..62a63ab 100644 (file)
@@ -95,7 +95,7 @@ static int arm_compute_static_chain_stack_bytes (void);
 static arm_stack_offsets *arm_get_frame_offsets (void);
 static void arm_add_gc_roots (void);
 static int arm_gen_constant (enum rtx_code, machine_mode, rtx,
-                            HOST_WIDE_INT, rtx, rtx, int, int);
+                            unsigned HOST_WIDE_INT, rtx, rtx, int, int);
 static unsigned bit_count (unsigned long);
 static unsigned feature_count (const arm_feature_set*);
 static int arm_address_register_rtx_p (rtx, int);
@@ -4229,8 +4229,8 @@ emit_constant_insn (rtx cond, rtx pattern)
 
 static int
 arm_gen_constant (enum rtx_code code, machine_mode mode, rtx cond,
-                 HOST_WIDE_INT val, rtx target, rtx source, int subtargets,
-                 int generate)
+                 unsigned HOST_WIDE_INT val, rtx target, rtx source,
+                 int subtargets, int generate)
 {
   int can_invert = 0;
   int can_negate = 0;
@@ -4600,7 +4600,7 @@ arm_gen_constant (enum rtx_code code, machine_mode mode, rtx cond,
          mvn   r0, r0, asl #12
          mvn   r0, r0, lsr #12  */
       if (set_sign_bit_copies > 8
-         && (val & (-1 << (32 - set_sign_bit_copies))) == val)
+         && (val & (HOST_WIDE_INT_M1U << (32 - set_sign_bit_copies))) == val)
        {
          if (generate)
            {