Commit 06140bdf by Richard Kenner

(validate_replace_rtx_1, case MINUS): New case.

From-SVN: r13869
parent eead6b5b
/* Subroutines used by or related to instruction recognition. /* Subroutines used by or related to instruction recognition.
Copyright (C) 1987, 88, 91-5, 1996 Free Software Foundation, Inc. Copyright (C) 1987, 1988, 1991-6, 1997 Free Software Foundation, Inc.
This file is part of GNU CC. This file is part of GNU CC.
...@@ -374,15 +374,28 @@ validate_replace_rtx_1 (loc, from, to, object) ...@@ -374,15 +374,28 @@ validate_replace_rtx_1 (loc, from, to, object)
} }
} }
/* Note that if CODE's RTX_CLASS is "c" or "<" we will have already
done the substitution, otherwise we won't. */
switch (code) switch (code)
{ {
case PLUS: case PLUS:
/* If we have have a PLUS whose second operand is now a CONST_INT, use /* If we have have a PLUS whose second operand is now a CONST_INT, use
plus_constant to try to simplify it. */ plus_constant to try to simplify it. */
if (GET_CODE (XEXP (x, 1)) == CONST_INT && XEXP (x, 1) == to) if (GET_CODE (XEXP (x, 1)) == CONST_INT && XEXP (x, 1) == to)
validate_change (object, loc, validate_change (object, loc, plus_constant (XEXP (x, 0), INTVAL (to)),
plus_constant (XEXP (x, 0), INTVAL (XEXP (x, 1))), 1); 1);
return; return;
case MINUS:
if (GET_CODE (to) == CONST_INT && XEXP (x, 1) == from)
{
validate_change (object, loc,
plus_constant (XEXP (x, 0), - INTVAL (to)),
1);
return;
}
break;
case ZERO_EXTEND: case ZERO_EXTEND:
case SIGN_EXTEND: case SIGN_EXTEND:
......
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