X-Git-Url: http://git.sourceforge.jp/view?p=pf3gnuchains%2Fgcc-fork.git;a=blobdiff_plain;f=gcc%2Fdojump.c;h=6dca9d32b57ba38697d6a36ec803fdbd76454757;hp=741c30a8dca7f7f797cd33ea9ffea90b64a2fe11;hb=0ff2061223a79ab60894db8561021f2eea33e8ed;hpb=d55715ee2cc10a4338add9a442a8656213767cee diff --git a/gcc/dojump.c b/gcc/dojump.c index 741c30a8dca..6dca9d32b57 100644 --- a/gcc/dojump.c +++ b/gcc/dojump.c @@ -510,6 +510,42 @@ do_jump (tree exp, rtx if_false_label, rtx if_true_label) } break; + case TRUTH_AND_EXPR: + /* High branch cost, expand as the bitwise AND of the conditions. */ + if (BRANCH_COST >= 4) + goto normal; + + if (if_false_label == NULL_RTX) + { + drop_through_label = gen_label_rtx (); + do_jump (TREE_OPERAND (exp, 0), drop_through_label, NULL_RTX); + do_jump (TREE_OPERAND (exp, 1), NULL_RTX, if_true_label); + } + else + { + do_jump (TREE_OPERAND (exp, 0), if_false_label, NULL_RTX); + do_jump (TREE_OPERAND (exp, 1), if_false_label, if_true_label); + } + break; + + case TRUTH_OR_EXPR: + /* High branch cost, expand as the bitwise OR of the conditions. */ + if (BRANCH_COST >= 4) + goto normal; + + if (if_true_label == NULL_RTX) + { + drop_through_label = gen_label_rtx (); + do_jump (TREE_OPERAND (exp, 0), NULL_RTX, drop_through_label); + do_jump (TREE_OPERAND (exp, 1), if_false_label, NULL_RTX); + } + else + { + do_jump (TREE_OPERAND (exp, 0), NULL_RTX, if_true_label); + do_jump (TREE_OPERAND (exp, 1), if_false_label, if_true_label); + } + break; + /* Special case: __builtin_expect (, 0) and __builtin_expect (, 1) @@ -540,8 +576,8 @@ do_jump (tree exp, rtx if_false_label, rtx if_true_label) } } } + /* Fall through and generate the normal code. */ - default: normal: temp = expand_expr (exp, NULL_RTX, VOIDmode, 0);