diff options
author | Brendan Kehoe <brendan@cygnus.com> | 1999-10-13 17:28:29 +0000 |
---|---|---|
committer | Brendan Kehoe <brendan@gcc.gnu.org> | 1999-10-13 13:28:29 -0400 |
commit | 9c07e4790f8d4f9d656febc37d5e93318c0a3ca0 (patch) | |
tree | b559d43a043dfcd6958e9e6b61b288a3f37ea958 /gcc/regmove.c | |
parent | e8f9b13a305dddbefab7d710706f033aa25f53ea (diff) | |
download | gcc-9c07e4790f8d4f9d656febc37d5e93318c0a3ca0.zip gcc-9c07e4790f8d4f9d656febc37d5e93318c0a3ca0.tar.gz gcc-9c07e4790f8d4f9d656febc37d5e93318c0a3ca0.tar.bz2 |
regmove.c (optimize_reg_copy_3): Make sure P is non-nil as we climb up the chain of insns.
* regmove.c (optimize_reg_copy_3): Make sure P is non-nil as we
climb up the chain of insns.
From-SVN: r29949
Diffstat (limited to 'gcc/regmove.c')
-rw-r--r-- | gcc/regmove.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/regmove.c b/gcc/regmove.c index 98061afa..c637743 100644 --- a/gcc/regmove.c +++ b/gcc/regmove.c @@ -679,7 +679,7 @@ optimize_reg_copy_3 (insn, dest, src) || ! find_reg_note (insn, REG_DEAD, src_reg) || REG_N_SETS (src_no) != 1) return; - for (p = PREV_INSN (insn); ! reg_set_p (src_reg, p); p = PREV_INSN (p)) + for (p = PREV_INSN (insn); p && ! reg_set_p (src_reg, p); p = PREV_INSN (p)) { if (GET_CODE (p) == CODE_LABEL || GET_CODE (p) == JUMP_INSN || (GET_CODE (p) == NOTE @@ -698,6 +698,9 @@ optimize_reg_copy_3 (insn, dest, src) if (GET_RTX_CLASS (GET_CODE (p)) != 'i') continue; } + if (! p) + return; + if (! (set = single_set (p)) || GET_CODE (SET_SRC (set)) != MEM || SET_DEST (set) != src_reg) |