Commit 60cd4dae by Jeff Law Committed by Jeff Law

expr.c (do_store_flag): Pass in the correct result type when calling fold_single_bit_test.

        * expr.c (do_store_flag): Pass in the correct result type
        when calling fold_single_bit_test.
        * fold-const.c (fold_single_bit_test): Use result_type for the
        result when folding a sign bit test.

From-SVN: r68940
parent 5e14ae7e
2003-07-04 Jeff Law <law@redhat.com>
* expr.c (do_store_flag): Pass in the correct result type
when calling fold_single_bit_test.
* fold-const.c (fold_single_bit_test): Use result_type for the
result when folding a sign bit test.
2003-07-04 Neil Booth <neil@daikokuya.co.uk> 2003-07-04 Neil Booth <neil@daikokuya.co.uk>
* opts.c (common_handle_options): Negate sense of -falign- switches. * opts.c (common_handle_options): Negate sense of -falign- switches.
......
...@@ -9998,9 +9998,12 @@ do_store_flag (tree exp, rtx target, enum machine_mode mode, int only_cheap) ...@@ -9998,9 +9998,12 @@ do_store_flag (tree exp, rtx target, enum machine_mode mode, int only_cheap)
if ((code == NE || code == EQ) if ((code == NE || code == EQ)
&& TREE_CODE (arg0) == BIT_AND_EXPR && integer_zerop (arg1) && TREE_CODE (arg0) == BIT_AND_EXPR && integer_zerop (arg1)
&& integer_pow2p (TREE_OPERAND (arg0, 1))) && integer_pow2p (TREE_OPERAND (arg0, 1)))
return expand_expr (fold_single_bit_test (code == NE ? NE_EXPR : EQ_EXPR, {
arg0, arg1, type), tree type = (*lang_hooks.types.type_for_mode) (mode, unsignedp);
target, VOIDmode, EXPAND_NORMAL); return expand_expr (fold_single_bit_test (code == NE ? NE_EXPR : EQ_EXPR,
arg0, arg1, type),
target, VOIDmode, EXPAND_NORMAL);
}
/* Now see if we are likely to be able to do this. Return if not. */ /* Now see if we are likely to be able to do this. Return if not. */
if (! can_compare_p (code, operand_mode, ccp_store_flag)) if (! can_compare_p (code, operand_mode, ccp_store_flag))
......
...@@ -4825,7 +4825,7 @@ fold_single_bit_test (code, arg0, arg1, result_type) ...@@ -4825,7 +4825,7 @@ fold_single_bit_test (code, arg0, arg1, result_type)
if (arg00 != NULL_TREE) if (arg00 != NULL_TREE)
{ {
tree stype = (*lang_hooks.types.signed_type) (TREE_TYPE (arg00)); tree stype = (*lang_hooks.types.signed_type) (TREE_TYPE (arg00));
return fold (build (code == EQ_EXPR ? GE_EXPR : LT_EXPR, type, return fold (build (code == EQ_EXPR ? GE_EXPR : LT_EXPR, result_type,
convert (stype, arg00), convert (stype, arg00),
convert (stype, integer_zero_node))); convert (stype, integer_zero_node)));
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment