Fix mask inversions in expand_copysign_bit.
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 2 Nov 2013 10:24:10 +0000 (10:24 +0000)
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 2 Nov 2013 10:24:10 +0000 (10:24 +0000)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/wide-int@204316 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/optabs.c

index cd5d685..2bd82b0 100644 (file)
@@ -3678,7 +3678,7 @@ expand_copysign_bit (enum machine_mode mode, rtx op0, rtx op1, rtx target,
              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 @@ expand_copysign_bit (enum machine_mode mode, rtx op0, rtx op1, rtx target,
       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);