diff options
author | J"orn Rennecke <amylaar@cygnus.co.uk> | 1999-09-01 14:22:05 -0700 |
---|---|---|
committer | Richard Henderson <rth@gcc.gnu.org> | 1999-09-01 14:22:05 -0700 |
commit | 2219e9215ef55ec201a8395ccd0d194f69d4c794 (patch) | |
tree | 63d05865f9074881f3f1d4122e48d9930054137c /gcc/regmove.c | |
parent | 6c2a11802aa20d3af78378c12c7184d276810fb3 (diff) | |
download | gcc-2219e9215ef55ec201a8395ccd0d194f69d4c794.tar.gz |
regmove.c (fixup_match_1): Don't move INSN in front of P if it would end up in the shadow of a live flags...
* regmove.c (fixup_match_1): Don't move INSN in front of P if
it would end up in the shadow of a live flags regsiter.
From-SVN: r29034
Diffstat (limited to 'gcc/regmove.c')
-rw-r--r-- | gcc/regmove.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/gcc/regmove.c b/gcc/regmove.c index 556b894acd8..11a5c704dd4 100644 --- a/gcc/regmove.c +++ b/gcc/regmove.c @@ -1737,6 +1737,13 @@ fixup_match_1 (insn, set, src, src_subreg, dst, backward, operand_number, if ((dst_note = find_regno_note (p, REG_DEAD, REGNO (dst))) && (GET_MODE (XEXP (dst_note, 0)) == GET_MODE (dst))) { + /* If we would be moving INSN, check that we won't move it + into the shadow of a live a live flags register. */ + /* ??? We only try to move it in front of P, although + we could move it anywhere between OVERLAP and P. */ + if (overlap && GET_MODE (PREV_INSN (p)) != VOIDmode) + break; + if (! src_note) { rtx q; @@ -1844,8 +1851,11 @@ fixup_match_1 (insn, set, src, src_subreg, dst, backward, operand_number, break; if (! src_note && reg_overlap_mentioned_p (src, PATTERN (p))) { - /* INSN was already checked to be movable when - we found no REG_DEAD note for src on it. */ + /* INSN was already checked to be movable wrt. the registers that it + sets / uses when we found no REG_DEAD note for src on it, but it + still might clobber the flags register. We'll have to check that + we won't insert it into the shadow of a live flags register when + we finally know where we are to move it. */ overlap = p; src_note = find_reg_note (p, REG_DEAD, src); } |