]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
*** empty log message ***
authorSteve Chamberlain <sac@gnu.org>
Wed, 20 Apr 1994 05:55:28 +0000 (05:55 +0000)
committerSteve Chamberlain <sac@gnu.org>
Wed, 20 Apr 1994 05:55:28 +0000 (05:55 +0000)
From-SVN: r7091

gcc/flow.c

index 74695a726e7b62aa536cf3d5b7b8b8bce0a4596e..825ecb197367e47fd942e3d8caaac0441d01ed4b 100644 (file)
@@ -2148,16 +2148,16 @@ find_auto_inc (needed, x, insn)
                  reg_n_calls_crossed[regno]++;
            }
 
-         if (win)
+         if (win
+             /* If we have found a suitable auto-increment, do
+                POST_INC around the register here, and patch out the
+                increment instruction that follows. */
+             && validate_change (insn, &XEXP (x, 0),
+                                 gen_rtx ((INTVAL (XEXP (y, 1)) == size
+                                           ? (offset ? PRE_INC : POST_INC)
+                                           : (offset ? PRE_DEC : POST_DEC)),
+                                          Pmode, addr), 0))
            {
-             /* We have found a suitable auto-increment: do POST_INC around
-                the register here, and patch out the increment instruction 
-                that follows. */
-             XEXP (x, 0) = gen_rtx ((INTVAL (XEXP (y, 1)) == size
-                                     ? (offset ? PRE_INC : POST_INC)
-                                     : (offset ? PRE_DEC : POST_DEC)),
-                                    Pmode, addr);
-
              /* Record that this insn has an implicit side effect.  */
              REG_NOTES (insn)
                = gen_rtx (EXPR_LIST, REG_INC, addr, REG_NOTES (insn));
@@ -2617,10 +2617,13 @@ try_pre_increment (insn, reg, amount)
   if (GET_MODE_SIZE (GET_MODE (use)) != (amount > 0 ? amount : - amount))
     return 0;
 
-  XEXP (use, 0) = gen_rtx (amount > 0
-                          ? (do_post ? POST_INC : PRE_INC)
-                          : (do_post ? POST_DEC : PRE_DEC),
-                          Pmode, reg);
+  /* See if this combination of instruction and addressing mode exists.  */
+  if (! validate_change (insn, &XEXP (use, 0),
+                        gen_rtx (amount > 0
+                                 ? (do_post ? POST_INC : PRE_INC)
+                                 : (do_post ? POST_DEC : PRE_DEC),
+                                 Pmode, reg), 0))
+    return 0;
 
   /* Record that this insn now has an implicit side effect on X.  */
   REG_NOTES (insn) = gen_rtx (EXPR_LIST, REG_INC, reg, REG_NOTES (insn));