From 3b10cf4be76c929ba27a62c3dfd70b8017155635 Mon Sep 17 00:00:00 2001 From: Mark Mitchell Date: Sun, 19 Sep 1999 16:04:01 +0000 Subject: rtl.h (insns_safe_to_move_p): New function. * rtl.h (insns_safe_to_move_p): New function. * loop.c (find_and_verify_loops): Use it. * rtlanal.c (insns_safe_to_move_p): Define it. From-SVN: r29509 --- gcc/loop.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'gcc/loop.c') diff --git a/gcc/loop.c b/gcc/loop.c index dcff685..cc278dc 100644 --- a/gcc/loop.c +++ b/gcc/loop.c @@ -2779,6 +2779,7 @@ find_and_verify_loops (f) { rtx p; rtx our_next = next_real_insn (insn); + rtx last_insn_to_move = NEXT_INSN (insn); int dest_loop; int outer_loop = -1; @@ -2830,7 +2831,11 @@ find_and_verify_loops (f) && INSN_UID (JUMP_LABEL (p)) != 0 && condjump_p (p) && ! simplejump_p (p) - && next_real_insn (JUMP_LABEL (p)) == our_next) + && next_real_insn (JUMP_LABEL (p)) == our_next + /* If it's not safe to move the sequence, then we + mustn't try. */ + && insns_safe_to_move_p (p, NEXT_INSN (insn), + &last_insn_to_move)) { rtx target = JUMP_LABEL (insn) ? JUMP_LABEL (insn) : get_last_insn (); @@ -2885,11 +2890,13 @@ find_and_verify_loops (f) /* Include the BARRIER after INSN and copy the block after LOC. */ - new_label = squeeze_notes (new_label, NEXT_INSN (insn)); - reorder_insns (new_label, NEXT_INSN (insn), loc); + new_label = squeeze_notes (new_label, + last_insn_to_move); + reorder_insns (new_label, last_insn_to_move, loc); /* All those insns are now in TARGET_LOOP_NUM. */ - for (q = new_label; q != NEXT_INSN (NEXT_INSN (insn)); + for (q = new_label; + q != NEXT_INSN (last_insn_to_move); q = NEXT_INSN (q)) uid_loop_num[INSN_UID (q)] = target_loop_num; -- cgit v1.1