aboutsummaryrefslogtreecommitdiff
path: root/gcc/recog.c
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1997-04-13 09:48:25 -0400
committerRichard Kenner <kenner@gcc.gnu.org>1997-04-13 09:48:25 -0400
commit06140bdfa1c2a5aabd241d03e9d1bb62ad89c9c3 (patch)
tree3b490103ae8d62f6518c1facd6b32d193ba20482 /gcc/recog.c
parenteead6b5bdaa008eed61307e1fe90b6d4c2e24dd1 (diff)
downloadgcc-06140bdfa1c2a5aabd241d03e9d1bb62ad89c9c3.zip
gcc-06140bdfa1c2a5aabd241d03e9d1bb62ad89c9c3.tar.gz
gcc-06140bdfa1c2a5aabd241d03e9d1bb62ad89c9c3.tar.bz2
(validate_replace_rtx_1, case MINUS): New case.
From-SVN: r13869
Diffstat (limited to 'gcc/recog.c')
-rw-r--r--gcc/recog.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/gcc/recog.c b/gcc/recog.c
index 3c7d14c..92fc6d8 100644
--- a/gcc/recog.c
+++ b/gcc/recog.c
@@ -1,5 +1,5 @@
/* 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.
@@ -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)
{
case PLUS:
/* If we have have a PLUS whose second operand is now a CONST_INT, use
plus_constant to try to simplify it. */
if (GET_CODE (XEXP (x, 1)) == CONST_INT && XEXP (x, 1) == to)
- validate_change (object, loc,
- plus_constant (XEXP (x, 0), INTVAL (XEXP (x, 1))), 1);
+ validate_change (object, loc, plus_constant (XEXP (x, 0), INTVAL (to)),
+ 1);
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 SIGN_EXTEND: