aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1992-07-04 13:59:44 -0400
committerRichard Kenner <kenner@gcc.gnu.org>1992-07-04 13:59:44 -0400
commitcc8765963d50329c6795b728b44514020b23b5d6 (patch)
treebfbd5172444b3212a53c044f3f7fed85b2b6d19d
parent0093e75b01730b9688f299e3abb6bf2703c96142 (diff)
downloadgcc-cc8765963d50329c6795b728b44514020b23b5d6.zip
gcc-cc8765963d50329c6795b728b44514020b23b5d6.tar.gz
gcc-cc8765963d50329c6795b728b44514020b23b5d6.tar.bz2
*** empty log message ***
From-SVN: r1428
-rw-r--r--gcc/combine.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/gcc/combine.c b/gcc/combine.c
index 922e6c6..5e6a183 100644
--- a/gcc/combine.c
+++ b/gcc/combine.c
@@ -302,17 +302,20 @@ struct undobuf
static struct undobuf undobuf;
-/* Substitute NEWVAL, an rtx expression, into INTO, a place in a some
+/* Substitute NEWVAL, an rtx expression, into INTO, a place in some
insn. The substitution can be undone by undo_all. If INTO is already
- set to NEWVAL, do not record this change. */
+ set to NEWVAL, do not record this change. Because computing NEWVAL might
+ also call SUBST, we have to compute it before we put anything into
+ the undo table. */
#define SUBST(INTO, NEWVAL) \
- do { if (undobuf.num_undo < MAX_UNDO) \
+ do { rtx _new = (NEWVAL); \
+ if (undobuf.num_undo < MAX_UNDO) \
{ \
undobuf.undo[undobuf.num_undo].where = &INTO; \
undobuf.undo[undobuf.num_undo].old_contents = INTO; \
undobuf.undo[undobuf.num_undo].is_int = 0; \
- INTO = NEWVAL; \
+ INTO = _new; \
if (undobuf.undo[undobuf.num_undo].old_contents != INTO) \
undobuf.num_undo++; \
} \