[PATCH, alpha]: Fix alpha bootstrap failure due to -Werror=shift-negative-value

Uros Bizjak ubizjak@gmail.com
Tue Sep 15 18:13:00 GMT 2015


2015-09-15  Uros Bizjak  <ubizjak@gmail.com>

    * config/alpha/alpha.c (alpha_expand_block_clear): Use
    HOST_WIDE_INT_M1U instead of ~(HOST_WIDE_INT)0 when shifting.

Bootstrapped and regression tested on alpha-linux-gnu.

Committed to mainline SVN.

Uros.
-------------- next part --------------
Index: config/alpha/alpha.c
===================================================================
--- config/alpha/alpha.c	(revision 227777)
+++ config/alpha/alpha.c	(working copy)
@@ -4057,10 +4057,10 @@ alpha_expand_block_clear (rtx operands[])
 	  mem = adjust_address (orig_dst, mode, ofs - inv_alignofs);
 	  set_mem_alias_set (mem, 0);
 
-	  mask = ~(~(HOST_WIDE_INT)0 << (inv_alignofs * 8));
+	  mask = ~(HOST_WIDE_INT_M1U << (inv_alignofs * 8));
 	  if (bytes < alignofs)
 	    {
-	      mask |= ~(HOST_WIDE_INT)0 << ((inv_alignofs + bytes) * 8);
+	      mask |= HOST_WIDE_INT_M1U << ((inv_alignofs + bytes) * 8);
 	      ofs += bytes;
 	      bytes = 0;
 	    }
@@ -4206,7 +4206,7 @@ alpha_expand_block_clear (rtx operands[])
 	  mem = adjust_address (orig_dst, DImode, ofs);
 	  set_mem_alias_set (mem, 0);
 
-	  mask = ~(HOST_WIDE_INT)0 << (bytes * 8);
+	  mask = HOST_WIDE_INT_M1U << (bytes * 8);
 
 	  tmp = expand_binop (DImode, and_optab, mem, GEN_INT (mask),
 			      NULL_RTX, 1, OPTAB_WIDEN);
@@ -4222,7 +4222,7 @@ alpha_expand_block_clear (rtx operands[])
 	  mem = adjust_address (orig_dst, SImode, ofs);
 	  set_mem_alias_set (mem, 0);
 
-	  mask = ~(HOST_WIDE_INT)0 << (bytes * 8);
+	  mask = HOST_WIDE_INT_M1U << (bytes * 8);
 
 	  tmp = expand_binop (SImode, and_optab, mem, GEN_INT (mask),
 			      NULL_RTX, 1, OPTAB_WIDEN);


More information about the Gcc-patches mailing list