Commit c6547c92 by Roger Sayle Committed by Roger Sayle

expr.c (expand_expr <PLUS_EXPR>): If operand_equal_p considers both operands of…

expr.c (expand_expr <PLUS_EXPR>): If operand_equal_p considers both operands of the addition equal...


	* expr.c (expand_expr <PLUS_EXPR>): If operand_equal_p considers
	both operands of the addition equal, reuse the expanded RTL.
	(expand_expr <MULT_EXPR>): Likewise for multiplication.

From-SVN: r68012
parent 21c43754
2003-06-16 Roger Sayle <roger@eyesopen.com>
* expr.c (expand_expr <PLUS_EXPR>): If operand_equal_p considers
both operands of the addition equal, reuse the expanded RTL.
(expand_expr <MULT_EXPR>): Likewise for multiplication.
2003-06-16 Roger Sayle <roger@eyesopen.com>
Jeff Law <law@redhat.com>
* fold-const.c (operand_equal_p): Consider two calls to "const"
......
......@@ -8226,7 +8226,11 @@ expand_expr (exp, target, tmode, modifier)
|| mode != ptr_mode)
{
op0 = expand_expr (TREE_OPERAND (exp, 0), subtarget, VOIDmode, 0);
op1 = expand_expr (TREE_OPERAND (exp, 1), NULL_RTX, VOIDmode, 0);
if (! operand_equal_p (TREE_OPERAND (exp, 0),
TREE_OPERAND (exp, 1), 0))
op1 = expand_expr (TREE_OPERAND (exp, 1), NULL_RTX, VOIDmode, 0);
else
op1 = op0;
if (op0 == const0_rtx)
return op1;
if (op1 == const0_rtx)
......@@ -8235,7 +8239,12 @@ expand_expr (exp, target, tmode, modifier)
}
op0 = expand_expr (TREE_OPERAND (exp, 0), subtarget, VOIDmode, modifier);
op1 = expand_expr (TREE_OPERAND (exp, 1), NULL_RTX, VOIDmode, modifier);
if (! operand_equal_p (TREE_OPERAND (exp, 0),
TREE_OPERAND (exp, 1), 0))
op1 = expand_expr (TREE_OPERAND (exp, 1), NULL_RTX,
VOIDmode, modifier);
else
op1 = op0;
/* We come here from MINUS_EXPR when the second operand is a
constant. */
......@@ -8457,7 +8466,11 @@ expand_expr (exp, target, tmode, modifier)
}
}
op0 = expand_expr (TREE_OPERAND (exp, 0), subtarget, VOIDmode, 0);
op1 = expand_expr (TREE_OPERAND (exp, 1), NULL_RTX, VOIDmode, 0);
if (! operand_equal_p (TREE_OPERAND (exp, 0),
TREE_OPERAND (exp, 1), 0))
op1 = expand_expr (TREE_OPERAND (exp, 1), NULL_RTX, VOIDmode, 0);
else
op1 = op0;
return expand_mult (mode, op0, op1, target, unsignedp);
case TRUNC_DIV_EXPR:
......
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