Commit 894207cf by Roger Sayle Committed by Roger Sayle

optabs.c (expand_binop): Attempt to reuse pseudos for duplicate non-volatile…

optabs.c (expand_binop): Attempt to reuse pseudos for duplicate non-volatile operands of binary operations.


	* optabs.c (expand_binop): Attempt to reuse pseudos for duplicate
	non-volatile operands of binary operations.
	(prepare_cmp_insn): Likewise.

From-SVN: r67417
parent 1063147c
2003-06-03 Roger Sayle <roger@eyesopen.com> 2003-06-03 Roger Sayle <roger@eyesopen.com>
* optabs.c (expand_binop): Attempt to reuse pseudos for duplicate
non-volatile operands of binary operations.
(prepare_cmp_insn): Likewise.
2003-06-03 Roger Sayle <roger@eyesopen.com>
* varasm.c (force_const_mem): Handle alignment of constants not * varasm.c (force_const_mem): Handle alignment of constants not
representable as a type in the front-end language. representable as a type in the front-end language.
......
...@@ -700,8 +700,17 @@ expand_binop (mode, binoptab, op0, op1, target, unsignedp, methods) ...@@ -700,8 +700,17 @@ expand_binop (mode, binoptab, op0, op1, target, unsignedp, methods)
if (flag_force_mem) if (flag_force_mem)
{ {
op0 = force_not_mem (op0); /* Load duplicate non-volatile operands once. */
op1 = force_not_mem (op1); if (rtx_equal_p (op0, op1) && ! volatile_refs_p (op0))
{
op0 = force_not_mem (op0);
op1 = op0;
}
else
{
op0 = force_not_mem (op0);
op1 = force_not_mem (op1);
}
} }
/* If subtracting an integer constant, convert this into an addition of /* If subtracting an integer constant, convert this into an addition of
...@@ -3587,8 +3596,17 @@ prepare_cmp_insn (px, py, pcomparison, size, pmode, punsignedp, purpose) ...@@ -3587,8 +3596,17 @@ prepare_cmp_insn (px, py, pcomparison, size, pmode, punsignedp, purpose)
if (mode != BLKmode && flag_force_mem) if (mode != BLKmode && flag_force_mem)
{ {
x = force_not_mem (x); /* Load duplicate non-volatile operands once. */
y = force_not_mem (y); if (rtx_equal_p (x, y) && ! volatile_refs_p (x))
{
x = force_not_mem (x);
y = x;
}
else
{
x = force_not_mem (x);
y = force_not_mem (y);
}
} }
/* If we are inside an appropriately-short loop and one operand is an /* If we are inside an appropriately-short loop and one operand is an
......
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