diff options
Diffstat (limited to 'gcc/simplify-rtx.c')
-rw-r--r-- | gcc/simplify-rtx.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c index 3357ceb1024..6b0d56ed3ea 100644 --- a/gcc/simplify-rtx.c +++ b/gcc/simplify-rtx.c @@ -613,7 +613,7 @@ simplify_unary_operation_1 (enum rtx_code code, enum machine_mode mode, rtx op) /* Similarly, (not (neg X)) is (plus X -1). */ if (GET_CODE (op) == NEG) - return plus_constant (XEXP (op, 0), -1); + return plus_constant (mode, XEXP (op, 0), -1); /* (not (xor X C)) for C constant is (xor X D) with D = ~C. */ if (GET_CODE (op) == XOR @@ -713,7 +713,7 @@ simplify_unary_operation_1 (enum rtx_code code, enum machine_mode mode, rtx op) /* Similarly, (neg (not X)) is (plus X 1). */ if (GET_CODE (op) == NOT) - return plus_constant (XEXP (op, 0), 1); + return plus_constant (mode, XEXP (op, 0), 1); /* (neg (minus X Y)) can become (minus Y X). This transformation isn't safe for modes with signed zeros, since if X and Y are @@ -782,7 +782,7 @@ simplify_unary_operation_1 (enum rtx_code code, enum machine_mode mode, rtx op) if (GET_CODE (op) == XOR && XEXP (op, 1) == const1_rtx && nonzero_bits (XEXP (op, 0), mode) == 1) - return plus_constant (XEXP (op, 0), -1); + return plus_constant (mode, XEXP (op, 0), -1); /* (neg (lt x 0)) is (ashiftrt X C) if STORE_FLAG_VALUE is 1. */ /* (neg (lt x 0)) is (lshiftrt X C) if STORE_FLAG_VALUE is -1. */ @@ -1954,12 +1954,12 @@ simplify_binary_operation_1 (enum rtx_code code, enum machine_mode mode, || GET_CODE (op0) == SYMBOL_REF || GET_CODE (op0) == LABEL_REF) && CONST_INT_P (op1)) - return plus_constant (op0, INTVAL (op1)); + return plus_constant (mode, op0, INTVAL (op1)); else if ((GET_CODE (op1) == CONST || GET_CODE (op1) == SYMBOL_REF || GET_CODE (op1) == LABEL_REF) && CONST_INT_P (op0)) - return plus_constant (op1, INTVAL (op0)); + return plus_constant (mode, op1, INTVAL (op0)); /* See if this is something like X * C - X or vice versa or if the multiplication is written as a shift. If so, we can @@ -2557,7 +2557,8 @@ simplify_binary_operation_1 (enum rtx_code code, enum machine_mode mode, if (mask >> count == INTVAL (trueop1) && (mask & nonzero_bits (XEXP (op0, 0), mode)) == 0) return simplify_gen_binary (ASHIFTRT, mode, - plus_constant (XEXP (op0, 0), mask), + plus_constant (mode, XEXP (op0, 0), + mask), XEXP (op0, 1)); } @@ -4118,7 +4119,8 @@ simplify_plus_minus (enum rtx_code code, enum machine_mode mode, rtx op0, rtx value = ops[n_ops - 1].op; if (ops[n_ops - 1].neg ^ ops[n_ops - 2].neg) value = neg_const_int (mode, value); - ops[n_ops - 2].op = plus_constant (ops[n_ops - 2].op, INTVAL (value)); + ops[n_ops - 2].op = plus_constant (mode, ops[n_ops - 2].op, + INTVAL (value)); n_ops--; } |