Patchwork [wide-int] Fix mask inversions in expand_copysign_bit

login
register
mail settings
Submitter Richard Sandiford
Date Nov. 2, 2013, 10:24 a.m.
Message ID <878ux7ksod.fsf@talisman.default>
Download mbox | patch
Permalink /patch/287966/
State New
Headers show

Comments

Richard Sandiford - Nov. 2, 2013, 10:24 a.m.
At some point the original "~"s got straightened to "-"s.

Tested on powerpc64-linux-gnu and x86_64-linux-gnu.  This fixed
a testsuite difference in bfin-elf.  Applied as obvious.

Thanks,
Richard

Patch

Index: gcc/optabs.c
===================================================================
--- gcc/optabs.c	(revision 204311)
+++ gcc/optabs.c	(working copy)
@@ -3678,7 +3678,7 @@ 
 	      if (!op0_is_abs)
 		op0_piece
 		  = expand_binop (imode, and_optab, op0_piece,
-				  immed_wide_int_const (-mask, imode),
+				  immed_wide_int_const (~mask, imode),
 				  NULL_RTX, 1, OPTAB_LIB_WIDEN);
 	      op1 = expand_binop (imode, and_optab,
 				  operand_subword_force (op1, i, mode),
@@ -3708,7 +3708,7 @@ 
       op0 = gen_lowpart (imode, op0);
       if (!op0_is_abs)
 	op0 = expand_binop (imode, and_optab, op0,
-			    immed_wide_int_const (-mask, imode),
+			    immed_wide_int_const (~mask, imode),
 			    NULL_RTX, 1, OPTAB_LIB_WIDEN);
       temp = expand_binop (imode, ior_optab, op0, op1,
 			   gen_lowpart (imode, target), 1, OPTAB_LIB_WIDEN);