+2011-05-23 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/48973
+ * expr.c (expand_expr_real_2) <case LT_EXPR>: If do_store_flag
+ failed and the comparison has a single bit signed type, use
+ constm1_rtx instead of const1_rtx for true value.
+ (do_store_flag): If ops->type is single bit signed type, disable
+ signel bit test optimization and pass -1 instead of 1 as last
+ parameter to emit_store_flag_force.
+
2011-05-23 Tom de Vries <tom@codesourcery.com>
PR target/45098
op1 = gen_label_rtx ();
jumpifnot_1 (code, treeop0, treeop1, op1, -1);
- emit_move_insn (target, const1_rtx);
+ if (TYPE_PRECISION (type) == 1 && !TYPE_UNSIGNED (type))
+ emit_move_insn (target, constm1_rtx);
+ else
+ emit_move_insn (target, const1_rtx);
emit_label (op1);
return target;
if ((code == NE || code == EQ)
&& TREE_CODE (arg0) == BIT_AND_EXPR && integer_zerop (arg1)
- && integer_pow2p (TREE_OPERAND (arg0, 1)))
+ && integer_pow2p (TREE_OPERAND (arg0, 1))
+ && (TYPE_PRECISION (ops->type) != 1 || TYPE_UNSIGNED (ops->type)))
{
tree type = lang_hooks.types.type_for_mode (mode, unsignedp);
return expand_expr (fold_single_bit_test (loc,
/* Try a cstore if possible. */
return emit_store_flag_force (target, code, op0, op1,
- operand_mode, unsignedp, 1);
+ operand_mode, unsignedp,
+ (TYPE_PRECISION (ops->type) == 1
+ && !TYPE_UNSIGNED (ops->type)) ? -1 : 1);
}
\f