OSDN Git Service

* flow.c (find_auto_inc): Also make sure there aren't
authorlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 8 Apr 1996 20:31:32 +0000 (20:31 +0000)
committerlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 8 Apr 1996 20:31:32 +0000 (20:31 +0000)
        any sets of the incremented register between the memory
        reference and increment insn.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@11682 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/flow.c

index a792e7f..7e55074 100644 (file)
@@ -2231,7 +2231,11 @@ find_auto_inc (needed, x, insn)
          else if (GET_CODE (q) == REG
                   /* PREV_INSN used here to check the semi-open interval
                      [insn,incr).  */
-                  && ! reg_used_between_p (q,  PREV_INSN (insn), incr))
+                  && ! reg_used_between_p (q,  PREV_INSN (insn), incr)
+                  /* We must also check for sets of q as q may be
+                     a call clobbered hard register and there may
+                     be a call between PREV_INSN (insn) and incr.  */
+                  && ! reg_set_between_p (q,  PREV_INSN (insn), incr))
            {
              /* We have *p followed sometime later by q = p+size.
                 Both p and q must be live afterward,