OSDN Git Service

*** empty log message ***
authorkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 4 Jul 1992 17:59:44 +0000 (17:59 +0000)
committerkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 4 Jul 1992 17:59:44 +0000 (17:59 +0000)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@1428 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/combine.c

index 922e6c6..5e6a183 100644 (file)
@@ -302,17 +302,20 @@ struct undobuf
 
 static struct undobuf undobuf;
 
-/* Substitute NEWVAL, an rtx expression, into INTO, a place in 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++;                                         \
        }                                                               \