- }
- if (JUMP_LABEL (insn) != 0 && simplejump_p (insn))
- {
- jump_chain[INSN_UID (insn)]
- = jump_chain[INSN_UID (JUMP_LABEL (insn))];
- jump_chain[INSN_UID (JUMP_LABEL (insn))] = insn;
- }
- if (GET_CODE (PATTERN (insn)) == RETURN)
- {
- jump_chain[INSN_UID (insn)] = jump_chain[0];
- jump_chain[0] = insn;
- }
- }
- }
-}
-
-/* Delete all labels already not referenced.
- Also find and return the last insn. */
-
-static rtx
-delete_unreferenced_labels (f)
- rtx f;
-{
- rtx final = NULL_RTX;
- rtx insn;
-
- for (insn = f; insn;)
- {
- if (GET_CODE (insn) == CODE_LABEL
- && LABEL_NUSES (insn) == 0
- && LABEL_ALTERNATE_NAME (insn) == NULL)
- insn = delete_insn (insn);
- else
- {
- final = insn;
- insn = NEXT_INSN (insn);
- }
- }
-
- return final;
-}
-
-/* Delete various simple forms of moves which have no necessary
- side effect. */
-
-static void
-delete_noop_moves (f)
- rtx f;
-{
- rtx insn, next;
-
- for (insn = f; insn;)
- {
- next = NEXT_INSN (insn);
-
- if (GET_CODE (insn) == INSN)
- {
- register rtx body = PATTERN (insn);
-
- /* Detect and delete no-op move instructions
- resulting from not allocating a parameter in a register. */
-
- if (GET_CODE (body) == SET && set_noop_p (body))
- delete_computation (insn);
-
- /* Detect and ignore no-op move instructions
- resulting from smart or fortuitous register allocation. */
-
- else if (GET_CODE (body) == SET)
- {
- int sreg = true_regnum (SET_SRC (body));
- int dreg = true_regnum (SET_DEST (body));
-
- if (sreg == dreg && sreg >= 0)
- delete_insn (insn);
- else if (sreg >= 0 && dreg >= 0)
- {
- rtx trial;
- rtx tem = find_equiv_reg (NULL_RTX, insn, 0,
- sreg, NULL_PTR, dreg,
- GET_MODE (SET_SRC (body)));
-
- if (tem != 0
- && GET_MODE (tem) == GET_MODE (SET_DEST (body)))
- {
- /* DREG may have been the target of a REG_DEAD note in
- the insn which makes INSN redundant. If so, reorg
- would still think it is dead. So search for such a
- note and delete it if we find it. */
- if (! find_regno_note (insn, REG_UNUSED, dreg))
- for (trial = prev_nonnote_insn (insn);
- trial && GET_CODE (trial) != CODE_LABEL;
- trial = prev_nonnote_insn (trial))
- if (find_regno_note (trial, REG_DEAD, dreg))
- {
- remove_death (dreg, trial);
- break;
- }
-
- /* Deleting insn could lose a death-note for SREG. */
- if ((trial = find_regno_note (insn, REG_DEAD, sreg)))
- {
- /* Change this into a USE so that we won't emit
- code for it, but still can keep the note. */
- PATTERN (insn)
- = gen_rtx_USE (VOIDmode, XEXP (trial, 0));
- INSN_CODE (insn) = -1;
- /* Remove all reg notes but the REG_DEAD one. */
- REG_NOTES (insn) = trial;
- XEXP (trial, 1) = NULL_RTX;
- }
- else
- delete_insn (insn);
- }
- }
- else if (dreg >= 0 && CONSTANT_P (SET_SRC (body))
- && find_equiv_reg (SET_SRC (body), insn, 0, dreg,
- NULL_PTR, 0,
- GET_MODE (SET_DEST (body))))
- {
- /* This handles the case where we have two consecutive
- assignments of the same constant to pseudos that didn't
- get a hard reg. Each SET from the constant will be
- converted into a SET of the spill register and an
- output reload will be made following it. This produces
- two loads of the same constant into the same spill
- register. */
-
- rtx in_insn = insn;
-
- /* Look back for a death note for the first reg.
- If there is one, it is no longer accurate. */
- while (in_insn && GET_CODE (in_insn) != CODE_LABEL)
- {
- if ((GET_CODE (in_insn) == INSN
- || GET_CODE (in_insn) == JUMP_INSN)
- && find_regno_note (in_insn, REG_DEAD, dreg))
- {
- remove_death (dreg, in_insn);
- break;
- }
- in_insn = PREV_INSN (in_insn);
- }
-
- /* Delete the second load of the value. */
- delete_insn (insn);
- }
- }
- else if (GET_CODE (body) == PARALLEL)
- {
- /* If each part is a set between two identical registers or
- a USE or CLOBBER, delete the insn. */
- int i, sreg, dreg;
- rtx tem;
-
- for (i = XVECLEN (body, 0) - 1; i >= 0; i--)
- {
- tem = XVECEXP (body, 0, i);
- if (GET_CODE (tem) == USE || GET_CODE (tem) == CLOBBER)
- continue;
-
- if (GET_CODE (tem) != SET
- || (sreg = true_regnum (SET_SRC (tem))) < 0
- || (dreg = true_regnum (SET_DEST (tem))) < 0
- || dreg != sreg)
- break;
- }
-
- if (i < 0)
- delete_insn (insn);
- }
- }
- insn = next;
- }
-}
-
-/* LOOP_START is a NOTE_INSN_LOOP_BEG note that is followed by an unconditional
- jump. Assume that this unconditional jump is to the exit test code. If
- the code is sufficiently simple, make a copy of it before INSN,
- followed by a jump to the exit of the loop. Then delete the unconditional
- jump after INSN.
-
- Return 1 if we made the change, else 0.
-
- This is only safe immediately after a regscan pass because it uses the
- values of regno_first_uid and regno_last_uid. */
-
-static int
-duplicate_loop_exit_test (loop_start)
- rtx loop_start;
-{
- rtx insn, set, reg, p, link;
- rtx copy = 0, first_copy = 0;
- int num_insns = 0;
- rtx exitcode = NEXT_INSN (JUMP_LABEL (next_nonnote_insn (loop_start)));
- rtx lastexit;
- int max_reg = max_reg_num ();
- rtx *reg_map = 0;
-
- /* Scan the exit code. We do not perform this optimization if any insn:
-
- is a CALL_INSN
- is a CODE_LABEL
- has a REG_RETVAL or REG_LIBCALL note (hard to adjust)
- is a NOTE_INSN_LOOP_BEG because this means we have a nested loop
- is a NOTE_INSN_BLOCK_{BEG,END} because duplicating these notes
- is not valid.
-
- We also do not do this if we find an insn with ASM_OPERANDS. While
- this restriction should not be necessary, copying an insn with
- ASM_OPERANDS can confuse asm_noperands in some cases.
-
- Also, don't do this if the exit code is more than 20 insns. */
-
- for (insn = exitcode;
- insn
- && ! (GET_CODE (insn) == NOTE
- && NOTE_LINE_NUMBER (insn) == NOTE_INSN_LOOP_END);
- insn = NEXT_INSN (insn))
- {
- switch (GET_CODE (insn))
- {
- case CODE_LABEL:
- case CALL_INSN:
- return 0;
- case NOTE:
- /* We could be in front of the wrong NOTE_INSN_LOOP_END if there is
- a jump immediately after the loop start that branches outside
- the loop but within an outer loop, near the exit test.
- If we copied this exit test and created a phony
- NOTE_INSN_LOOP_VTOP, this could make instructions immediately
- before the exit test look like these could be safely moved
- out of the loop even if they actually may be never executed.
- This can be avoided by checking here for NOTE_INSN_LOOP_CONT. */
-
- if (NOTE_LINE_NUMBER (insn) == NOTE_INSN_LOOP_BEG
- || NOTE_LINE_NUMBER (insn) == NOTE_INSN_LOOP_CONT)
- return 0;
-
- if (optimize < 2
- && (NOTE_LINE_NUMBER (insn) == NOTE_INSN_BLOCK_BEG
- || NOTE_LINE_NUMBER (insn) == NOTE_INSN_BLOCK_END))
- /* If we were to duplicate this code, we would not move
- the BLOCK notes, and so debugging the moved code would
- be difficult. Thus, we only move the code with -O2 or
- higher. */
- return 0;
-
- break;
- case JUMP_INSN:
- case INSN:
- /* The code below would grossly mishandle REG_WAS_0 notes,
- so get rid of them here. */
- while ((p = find_reg_note (insn, REG_WAS_0, NULL_RTX)) != 0)
- remove_note (insn, p);
- if (++num_insns > 20
- || find_reg_note (insn, REG_RETVAL, NULL_RTX)
- || find_reg_note (insn, REG_LIBCALL, NULL_RTX))
- return 0;
- break;
- default:
- break;
- }
- }
-
- /* Unless INSN is zero, we can do the optimization. */
- if (insn == 0)
- return 0;
-
- lastexit = insn;
-
- /* See if any insn sets a register only used in the loop exit code and
- not a user variable. If so, replace it with a new register. */
- for (insn = exitcode; insn != lastexit; insn = NEXT_INSN (insn))
- if (GET_CODE (insn) == INSN
- && (set = single_set (insn)) != 0
- && ((reg = SET_DEST (set), GET_CODE (reg) == REG)
- || (GET_CODE (reg) == SUBREG
- && (reg = SUBREG_REG (reg), GET_CODE (reg) == REG)))
- && REGNO (reg) >= FIRST_PSEUDO_REGISTER
- && REGNO_FIRST_UID (REGNO (reg)) == INSN_UID (insn))
- {
- for (p = NEXT_INSN (insn); p != lastexit; p = NEXT_INSN (p))
- if (REGNO_LAST_UID (REGNO (reg)) == INSN_UID (p))
- break;
-
- if (p != lastexit)
- {
- /* We can do the replacement. Allocate reg_map if this is the
- first replacement we found. */
- if (reg_map == 0)
- reg_map = (rtx *) xcalloc (max_reg, sizeof (rtx));
-
- REG_LOOP_TEST_P (reg) = 1;
-
- reg_map[REGNO (reg)] = gen_reg_rtx (GET_MODE (reg));
- }
- }
-
- /* Now copy each insn. */
- for (insn = exitcode; insn != lastexit; insn = NEXT_INSN (insn))
- {
- switch (GET_CODE (insn))
- {
- case BARRIER:
- copy = emit_barrier_before (loop_start);
- break;
- case NOTE:
- /* Only copy line-number notes. */
- if (NOTE_LINE_NUMBER (insn) >= 0)
- {
- copy = emit_note_before (NOTE_LINE_NUMBER (insn), loop_start);
- NOTE_SOURCE_FILE (copy) = NOTE_SOURCE_FILE (insn);
- }
- break;
-
- case INSN:
- copy = emit_insn_before (copy_insn (PATTERN (insn)), loop_start);
- if (reg_map)
- replace_regs (PATTERN (copy), reg_map, max_reg, 1);
-
- mark_jump_label (PATTERN (copy), copy, 0, 0);
-
- /* Copy all REG_NOTES except REG_LABEL since mark_jump_label will
- make them. */
- for (link = REG_NOTES (insn); link; link = XEXP (link, 1))
- if (REG_NOTE_KIND (link) != REG_LABEL)
- {
- if (GET_CODE (link) == EXPR_LIST)
- REG_NOTES (copy)
- = copy_insn_1 (gen_rtx_EXPR_LIST (REG_NOTE_KIND (link),
- XEXP (link, 0),
- REG_NOTES (copy)));
- else
- REG_NOTES (copy)
- = copy_insn_1 (gen_rtx_INSN_LIST (REG_NOTE_KIND (link),
- XEXP (link, 0),
- REG_NOTES (copy)));
- }
-
- if (reg_map && REG_NOTES (copy))
- replace_regs (REG_NOTES (copy), reg_map, max_reg, 1);
- break;
-
- case JUMP_INSN:
- copy = emit_jump_insn_before (copy_insn (PATTERN (insn)),
- loop_start);
- if (reg_map)
- replace_regs (PATTERN (copy), reg_map, max_reg, 1);
- mark_jump_label (PATTERN (copy), copy, 0, 0);
- if (REG_NOTES (insn))
- {
- REG_NOTES (copy) = copy_insn_1 (REG_NOTES (insn));
- if (reg_map)
- replace_regs (REG_NOTES (copy), reg_map, max_reg, 1);
- }
-
- /* If this is a simple jump, add it to the jump chain. */
-
- if (INSN_UID (copy) < max_jump_chain && JUMP_LABEL (copy)
- && simplejump_p (copy))
- {
- jump_chain[INSN_UID (copy)]
- = jump_chain[INSN_UID (JUMP_LABEL (copy))];
- jump_chain[INSN_UID (JUMP_LABEL (copy))] = copy;
- }
- break;
-
- default:
- abort ();
- }
-
- /* Record the first insn we copied. We need it so that we can
- scan the copied insns for new pseudo registers. */
- if (! first_copy)
- first_copy = copy;
- }
-
- /* Now clean up by emitting a jump to the end label and deleting the jump
- at the start of the loop. */
- if (! copy || GET_CODE (copy) != BARRIER)
- {
- copy = emit_jump_insn_before (gen_jump (get_label_after (insn)),
- loop_start);
-
- /* Record the first insn we copied. We need it so that we can
- scan the copied insns for new pseudo registers. This may not
- be strictly necessary since we should have copied at least one
- insn above. But I am going to be safe. */
- if (! first_copy)
- first_copy = copy;
-
- mark_jump_label (PATTERN (copy), copy, 0, 0);
- if (INSN_UID (copy) < max_jump_chain
- && INSN_UID (JUMP_LABEL (copy)) < max_jump_chain)
- {
- jump_chain[INSN_UID (copy)]
- = jump_chain[INSN_UID (JUMP_LABEL (copy))];
- jump_chain[INSN_UID (JUMP_LABEL (copy))] = copy;
- }
- emit_barrier_before (loop_start);
- }
-
- /* Now scan from the first insn we copied to the last insn we copied
- (copy) for new pseudo registers. Do this after the code to jump to
- the end label since that might create a new pseudo too. */
- reg_scan_update (first_copy, copy, max_reg);
-
- /* Mark the exit code as the virtual top of the converted loop. */
- emit_note_before (NOTE_INSN_LOOP_VTOP, exitcode);
-
- delete_insn (next_nonnote_insn (loop_start));
-
- /* Clean up. */
- if (reg_map)
- free (reg_map);
-
- return 1;
-}
-\f
-/* Move all block-beg, block-end, loop-beg, loop-cont, loop-vtop, loop-end,
- notes between START and END out before START. Assume that END is not
- such a note. START may be such a note. Returns the value of the new
- starting insn, which may be different if the original start was such a
- note. */
-
-rtx
-squeeze_notes (start, end)
- rtx start, end;
-{
- rtx insn;
- rtx next;
-
- for (insn = start; insn != end; insn = next)
- {
- next = NEXT_INSN (insn);
- if (GET_CODE (insn) == NOTE
- && (NOTE_LINE_NUMBER (insn) == NOTE_INSN_BLOCK_END
- || NOTE_LINE_NUMBER (insn) == NOTE_INSN_BLOCK_BEG
- || NOTE_LINE_NUMBER (insn) == NOTE_INSN_LOOP_BEG
- || NOTE_LINE_NUMBER (insn) == NOTE_INSN_LOOP_END
- || NOTE_LINE_NUMBER (insn) == NOTE_INSN_LOOP_CONT
- || NOTE_LINE_NUMBER (insn) == NOTE_INSN_LOOP_VTOP))
- {
- if (insn == start)
- start = next;
- else
- {
- rtx prev = PREV_INSN (insn);
- PREV_INSN (insn) = PREV_INSN (start);
- NEXT_INSN (insn) = start;
- NEXT_INSN (PREV_INSN (insn)) = insn;
- PREV_INSN (NEXT_INSN (insn)) = insn;
- NEXT_INSN (prev) = next;
- PREV_INSN (next) = prev;
- }
- }
- }
-
- return start;
-}
-\f
-/* Compare the instructions before insn E1 with those before E2
- to find an opportunity for cross jumping.
- (This means detecting identical sequences of insns followed by
- jumps to the same place, or followed by a label and a jump
- to that label, and replacing one with a jump to the other.)
-
- Assume E1 is a jump that jumps to label E2
- (that is not always true but it might as well be).
- Find the longest possible equivalent sequences
- and store the first insns of those sequences into *F1 and *F2.
- Store zero there if no equivalent preceding instructions are found.
-
- We give up if we find a label in stream 1.
- Actually we could transfer that label into stream 2. */
-
-static void
-find_cross_jump (e1, e2, minimum, f1, f2)
- rtx e1, e2;
- int minimum;
- rtx *f1, *f2;
-{
- register rtx i1 = e1, i2 = e2;
- register rtx p1, p2;
- int lose = 0;
-
- rtx last1 = 0, last2 = 0;
- rtx afterlast1 = 0, afterlast2 = 0;
-
- *f1 = 0;
- *f2 = 0;
-
- while (1)
- {
- i1 = prev_nonnote_insn (i1);
-
- i2 = PREV_INSN (i2);
- while (i2 && (GET_CODE (i2) == NOTE || GET_CODE (i2) == CODE_LABEL))
- i2 = PREV_INSN (i2);
-
- if (i1 == 0)
- break;
-
- /* Don't allow the range of insns preceding E1 or E2
- to include the other (E2 or E1). */
- if (i2 == e1 || i1 == e2)
- break;
-
- /* If we will get to this code by jumping, those jumps will be
- tensioned to go directly to the new label (before I2),
- so this cross-jumping won't cost extra. So reduce the minimum. */
- if (GET_CODE (i1) == CODE_LABEL)
- {
- --minimum;
- break;
- }
-
- if (i2 == 0 || GET_CODE (i1) != GET_CODE (i2))
- break;
-
- p1 = PATTERN (i1);
- p2 = PATTERN (i2);
-
- /* If this is a CALL_INSN, compare register usage information.
- If we don't check this on stack register machines, the two
- CALL_INSNs might be merged leaving reg-stack.c with mismatching
- numbers of stack registers in the same basic block.
- If we don't check this on machines with delay slots, a delay slot may
- be filled that clobbers a parameter expected by the subroutine.
-
- ??? We take the simple route for now and assume that if they're
- equal, they were constructed identically. */
-
- if (GET_CODE (i1) == CALL_INSN
- && ! rtx_equal_p (CALL_INSN_FUNCTION_USAGE (i1),
- CALL_INSN_FUNCTION_USAGE (i2)))
- lose = 1;
-
-#ifdef STACK_REGS
- /* If cross_jump_death_matters is not 0, the insn's mode
- indicates whether or not the insn contains any stack-like
- regs. */
-
- if (!lose && cross_jump_death_matters && stack_regs_mentioned (i1))
- {
- /* If register stack conversion has already been done, then
- death notes must also be compared before it is certain that
- the two instruction streams match. */
-
- rtx note;
- HARD_REG_SET i1_regset, i2_regset;
-
- CLEAR_HARD_REG_SET (i1_regset);
- CLEAR_HARD_REG_SET (i2_regset);
-
- for (note = REG_NOTES (i1); note; note = XEXP (note, 1))
- if (REG_NOTE_KIND (note) == REG_DEAD
- && STACK_REG_P (XEXP (note, 0)))
- SET_HARD_REG_BIT (i1_regset, REGNO (XEXP (note, 0)));
-
- for (note = REG_NOTES (i2); note; note = XEXP (note, 1))
- if (REG_NOTE_KIND (note) == REG_DEAD
- && STACK_REG_P (XEXP (note, 0)))
- SET_HARD_REG_BIT (i2_regset, REGNO (XEXP (note, 0)));
-
- GO_IF_HARD_REG_EQUAL (i1_regset, i2_regset, done);
-
- lose = 1;
-
- done:
- ;
- }
-#endif
-
- /* Don't allow old-style asm or volatile extended asms to be accepted
- for cross jumping purposes. It is conceptually correct to allow
- them, since cross-jumping preserves the dynamic instruction order
- even though it is changing the static instruction order. However,
- if an asm is being used to emit an assembler pseudo-op, such as
- the MIPS `.set reorder' pseudo-op, then the static instruction order
- matters and it must be preserved. */
- if (GET_CODE (p1) == ASM_INPUT || GET_CODE (p2) == ASM_INPUT
- || (GET_CODE (p1) == ASM_OPERANDS && MEM_VOLATILE_P (p1))
- || (GET_CODE (p2) == ASM_OPERANDS && MEM_VOLATILE_P (p2)))
- lose = 1;
-
- if (lose || GET_CODE (p1) != GET_CODE (p2)
- || ! rtx_renumbered_equal_p (p1, p2))
- {
- /* The following code helps take care of G++ cleanups. */
- rtx equiv1;
- rtx equiv2;
-
- if (!lose && GET_CODE (p1) == GET_CODE (p2)
- && ((equiv1 = find_reg_note (i1, REG_EQUAL, NULL_RTX)) != 0
- || (equiv1 = find_reg_note (i1, REG_EQUIV, NULL_RTX)) != 0)
- && ((equiv2 = find_reg_note (i2, REG_EQUAL, NULL_RTX)) != 0
- || (equiv2 = find_reg_note (i2, REG_EQUIV, NULL_RTX)) != 0)
- /* If the equivalences are not to a constant, they may
- reference pseudos that no longer exist, so we can't
- use them. */
- && CONSTANT_P (XEXP (equiv1, 0))
- && rtx_equal_p (XEXP (equiv1, 0), XEXP (equiv2, 0)))
- {
- rtx s1 = single_set (i1);
- rtx s2 = single_set (i2);
- if (s1 != 0 && s2 != 0
- && rtx_renumbered_equal_p (SET_DEST (s1), SET_DEST (s2)))
- {
- validate_change (i1, &SET_SRC (s1), XEXP (equiv1, 0), 1);
- validate_change (i2, &SET_SRC (s2), XEXP (equiv2, 0), 1);
- if (! rtx_renumbered_equal_p (p1, p2))
- cancel_changes (0);
- else if (apply_change_group ())
- goto win;
- }
- }
-
- /* Insns fail to match; cross jumping is limited to the following
- insns. */
-
-#ifdef HAVE_cc0
- /* Don't allow the insn after a compare to be shared by
- cross-jumping unless the compare is also shared.
- Here, if either of these non-matching insns is a compare,
- exclude the following insn from possible cross-jumping. */
- if (sets_cc0_p (p1) || sets_cc0_p (p2))
- last1 = afterlast1, last2 = afterlast2, ++minimum;
-#endif
-
- /* If cross-jumping here will feed a jump-around-jump
- optimization, this jump won't cost extra, so reduce
- the minimum. */
- if (GET_CODE (i1) == JUMP_INSN
- && JUMP_LABEL (i1)
- && prev_real_insn (JUMP_LABEL (i1)) == e1)
- --minimum;
- break;
- }
-
- win:
- if (GET_CODE (p1) != USE && GET_CODE (p1) != CLOBBER)
- {
- /* Ok, this insn is potentially includable in a cross-jump here. */
- afterlast1 = last1, afterlast2 = last2;
- last1 = i1, last2 = i2, --minimum;
- }
- }
-
- if (minimum <= 0 && last1 != 0 && last1 != e1)
- *f1 = last1, *f2 = last2;
-}
-
-static void
-do_cross_jump (insn, newjpos, newlpos)
- rtx insn, newjpos, newlpos;
-{
- /* Find an existing label at this point
- or make a new one if there is none. */
- register rtx label = get_label_before (newlpos);
-
- /* Make the same jump insn jump to the new point. */
- if (GET_CODE (PATTERN (insn)) == RETURN)
- {
- /* Remove from jump chain of returns. */
- delete_from_jump_chain (insn);
- /* Change the insn. */
- PATTERN (insn) = gen_jump (label);
- INSN_CODE (insn) = -1;
- JUMP_LABEL (insn) = label;
- LABEL_NUSES (label)++;
- /* Add to new the jump chain. */
- if (INSN_UID (label) < max_jump_chain
- && INSN_UID (insn) < max_jump_chain)
- {
- jump_chain[INSN_UID (insn)] = jump_chain[INSN_UID (label)];
- jump_chain[INSN_UID (label)] = insn;
- }
- }
- else
- redirect_jump (insn, label, 1);
-
- /* Delete the matching insns before the jump. Also, remove any REG_EQUAL
- or REG_EQUIV note in the NEWLPOS stream that isn't also present in
- the NEWJPOS stream. */
-
- while (newjpos != insn)
- {
- rtx lnote;
-
- for (lnote = REG_NOTES (newlpos); lnote; lnote = XEXP (lnote, 1))
- if ((REG_NOTE_KIND (lnote) == REG_EQUAL
- || REG_NOTE_KIND (lnote) == REG_EQUIV)
- && ! find_reg_note (newjpos, REG_EQUAL, XEXP (lnote, 0))
- && ! find_reg_note (newjpos, REG_EQUIV, XEXP (lnote, 0)))
- remove_note (newlpos, lnote);
-
- delete_insn (newjpos);
- newjpos = next_real_insn (newjpos);
- newlpos = next_real_insn (newlpos);
- }
-}
-\f
-/* Return the label before INSN, or put a new label there. */
-
-rtx
-get_label_before (insn)
- rtx insn;
-{
- rtx label;
-
- /* Find an existing label at this point
- or make a new one if there is none. */
- label = prev_nonnote_insn (insn);
-
- if (label == 0 || GET_CODE (label) != CODE_LABEL)
- {
- rtx prev = PREV_INSN (insn);
-
- label = gen_label_rtx ();
- emit_label_after (label, prev);
- LABEL_NUSES (label) = 0;
- }
- return label;
-}
-
-/* Return the label after INSN, or put a new label there. */
-
-rtx
-get_label_after (insn)
- rtx insn;
-{
- rtx label;
-
- /* Find an existing label at this point
- or make a new one if there is none. */
- label = next_nonnote_insn (insn);
-
- if (label == 0 || GET_CODE (label) != CODE_LABEL)
- {
- label = gen_label_rtx ();
- emit_label_after (label, insn);
- LABEL_NUSES (label) = 0;
- }
- return label;
-}
-\f
-/* Return 1 if INSN is a jump that jumps to right after TARGET
- only on the condition that TARGET itself would drop through.
- Assumes that TARGET is a conditional jump. */
-
-static int
-jump_back_p (insn, target)
- rtx insn, target;
-{
- rtx cinsn, ctarget;
- enum rtx_code codei, codet;
- rtx set, tset;
-
- if (! any_condjump_p (insn)
- || any_uncondjump_p (target)
- || target != prev_real_insn (JUMP_LABEL (insn)))
- return 0;
- set = pc_set (insn);
- tset = pc_set (target);
-
- cinsn = XEXP (SET_SRC (set), 0);
- ctarget = XEXP (SET_SRC (tset), 0);
-
- codei = GET_CODE (cinsn);
- codet = GET_CODE (ctarget);
-
- if (XEXP (SET_SRC (set), 1) == pc_rtx)