summaryrefslogtreecommitdiff
path: root/gcc/regmove.c
diff options
context:
space:
mode:
authorbrendan <brendan@138bc75d-0d04-0410-961f-82ee72b054a4>1999-10-13 17:28:29 +0000
committerbrendan <brendan@138bc75d-0d04-0410-961f-82ee72b054a4>1999-10-13 17:28:29 +0000
commit422c88923ada00584c7cb8f9bceb160fdee489b4 (patch)
treeb559d43a043dfcd6958e9e6b61b288a3f37ea958 /gcc/regmove.c
parenta5deb6f6f673dbab2380742300fd418e57741303 (diff)
downloadgcc-422c88923ada00584c7cb8f9bceb160fdee489b4.tar.gz
* regmove.c (optimize_reg_copy_3): Make sure P is non-nil as we
climb up the chain of insns. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@29949 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/regmove.c')
-rw-r--r--gcc/regmove.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/regmove.c b/gcc/regmove.c
index 98061afa482..c637743e595 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)