loop.c (simplify_giv_expr): Adding two invariants results in an invariant.

* loop.c (simplify_giv_expr): Adding two invariants results
        in an invariant.

From-SVN: r16179
This commit is contained in:
Jeffrey A Law 1997-10-26 16:20:07 +00:00 committed by Jeff Law
parent ca0f22208f
commit da0af5a56f
2 changed files with 16 additions and 1 deletions

View File

@ -1,3 +1,8 @@
Sun Oct 26 09:21:40 1997 Jeffrey A Law (law@cygnus.com)
* loop.c (simplify_giv_expr): Adding two invariants results
in an invariant.
Sun Oct 26 09:15:15 1997 Richard Henderson <rth@cygnus.com>
* expr.c (get_inner_reference): Remove the array bias after

View File

@ -5353,10 +5353,13 @@ simplify_giv_expr (x, benefit)
case CONST_INT:
case USE:
/* Both invariant. Only valid if sum is machine operand.
First strip off possible USE on first operand. */
First strip off possible USE on the operands. */
if (GET_CODE (arg0) == USE)
arg0 = XEXP (arg0, 0);
if (GET_CODE (arg1) == USE)
arg1 = XEXP (arg1, 0);
tem = 0;
if (CONSTANT_P (arg0) && GET_CODE (arg1) == CONST_INT)
{
@ -5364,6 +5367,13 @@ simplify_giv_expr (x, benefit)
if (GET_CODE (tem) != CONST_INT)
tem = gen_rtx (USE, mode, tem);
}
else
{
/* Adding two invariants must result in an invariant,
so enclose addition operation inside a USE and
return it. */
tem = gen_rtx (USE, mode, gen_rtx (PLUS, mode, arg0, arg1));
}
return tem;