===================================================================
@@ -325,15 +325,20 @@
break;
case TRUTH_ORIF_EXPR:
+ /* Spread the probability evenly between the two conditions. So
+ the first condition has half the total probability of being true,
+ and therefore has half the probability of being false
+ (i.e. falls through to the second condition). If we reach the
+ second condition, it will be true with the original probability. */
if (if_true_label == NULL_RTX)
{
drop_through_label = gen_label_rtx ();
- do_jump (op0, NULL_RTX, drop_through_label, prob);
+ do_jump (op0, NULL_RTX, drop_through_label, prob / 2);
do_jump (op1, if_false_label, NULL_RTX, prob);
}
else
{
- do_jump (op0, NULL_RTX, if_true_label, prob);
+ do_jump (op0, NULL_RTX, if_true_label, prob / 2);
do_jump (op1, if_false_label, if_true_label, prob);
}
break;