Commit 97191ef9 by Paolo Bonzini Committed by Paolo Bonzini

dojump.c (do_jump): Handle side-effecting TRUTH_AND_EXPR and TRUTH_OR_EXPR.

2005-10-21  Paolo Bonzini  <bonzini@gnu.org>

	* dojump.c (do_jump): Handle side-effecting TRUTH_AND_EXPR and
	TRUTH_OR_EXPR.

From-SVN: r105723
parent b68fe994
2005-10-21 Paolo Bonzini <bonzini@gnu.org>
* dojump.c (do_jump): Handle side-effecting TRUTH_AND_EXPR and
TRUTH_OR_EXPR.
2005-10-20 Steven Bosscher <stevenb@suse.de> 2005-10-20 Steven Bosscher <stevenb@suse.de>
PR tree-optimization/24225 PR tree-optimization/24225
......
...@@ -511,8 +511,10 @@ do_jump (tree exp, rtx if_false_label, rtx if_true_label) ...@@ -511,8 +511,10 @@ do_jump (tree exp, rtx if_false_label, rtx if_true_label)
break; break;
case TRUTH_AND_EXPR: case TRUTH_AND_EXPR:
/* High branch cost, expand as the bitwise AND of the conditions. */ /* High branch cost, expand as the bitwise AND of the conditions.
if (BRANCH_COST >= 4) Do the same if the RHS has side effects, because we're effectively
turning a TRUTH_AND_EXPR into a TRUTH_ANDIF_EXPR. */
if (BRANCH_COST >= 4 || TREE_SIDE_EFFECTS (TREE_OPERAND (exp, 1)))
goto normal; goto normal;
if (if_false_label == NULL_RTX) if (if_false_label == NULL_RTX)
...@@ -529,8 +531,10 @@ do_jump (tree exp, rtx if_false_label, rtx if_true_label) ...@@ -529,8 +531,10 @@ do_jump (tree exp, rtx if_false_label, rtx if_true_label)
break; break;
case TRUTH_OR_EXPR: case TRUTH_OR_EXPR:
/* High branch cost, expand as the bitwise OR of the conditions. */ /* High branch cost, expand as the bitwise OR of the conditions.
if (BRANCH_COST >= 4) Do the same if the RHS has side effects, because we're effectively
turning a TRUTH_OR_EXPR into a TRUTH_ORIF_EXPR. */
if (BRANCH_COST >= 4 || TREE_SIDE_EFFECTS (TREE_OPERAND (exp, 1)))
goto normal; goto normal;
if (if_true_label == NULL_RTX) if (if_true_label == NULL_RTX)
......
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