- int value_regno = REGNO (DECL_RTL (DECL_RESULT (current_function_decl)));
-
- for (block = blocks - 1; block >= 0; block--)
- if (GET_CODE (block_end[block]) == JUMP_INSN
- && GET_CODE (PATTERN (block_end[block])) == RETURN)
- SET_HARD_REG_BIT (block_out_reg_set[block], value_regno);
-
- /* Mark of the end of last block if we "fall off" the end of the
- function into the epilogue. */
-
- if (GET_CODE (block_end[blocks-1]) != JUMP_INSN
- || GET_CODE (PATTERN (block_end[blocks-1])) == RETURN)
- SET_HARD_REG_BIT (block_out_reg_set[blocks-1], value_regno);
- }
-
- /* now scan all blocks backward for stack register use */
-
- block = blocks - 1;
- while (block >= 0)
- {
- register rtx insn, prev;
-
- /* current register status at last instruction */
-
- COPY_HARD_REG_SET (regstack.reg_set, block_out_reg_set[block]);
-
- prev = block_end[block];
- do
- {
- insn = prev;
- prev = PREV_INSN (insn);
-
- /* If the insn is a CALL_INSN, we need to ensure that
- everything dies. But otherwise don't process unless there
- are some stack regs present. */
-
- if (GET_MODE (insn) == QImode || GET_CODE (insn) == CALL_INSN)
- record_reg_life (insn, block, ®stack);
-
- } while (insn != block_begin[block]);
-
- /* Set the state at the start of the block. Mark that no
- register mapping information known yet. */
-
- COPY_HARD_REG_SET (block_stack_in[block].reg_set, regstack.reg_set);
- block_stack_in[block].top = -2;
-
- /* If there is a label, propagate our register life to all jumps
- to this label. */
-
- if (GET_CODE (insn) == CODE_LABEL)
- {
- register rtx label;
- int must_restart = 0;
-
- for (label = LABEL_REFS (insn); label != insn;
- label = LABEL_NEXTREF (label))
- {
- int jump_block = BLOCK_NUM (CONTAINING_INSN (label));
-
- if (jump_block < block)
- IOR_HARD_REG_SET (block_out_reg_set[jump_block],
- block_stack_in[block].reg_set);
- else
- {
- /* The block containing the jump has already been
- processed. If there are registers that were not known
- to be live then, but are live now, we must back up
- and restart life analysis from that point with the new
- life information. */
-
- GO_IF_HARD_REG_SUBSET (block_stack_in[block].reg_set,
- block_out_reg_set[jump_block],
- win);
-
- IOR_HARD_REG_SET (block_out_reg_set[jump_block],
- block_stack_in[block].reg_set);
-
- block = jump_block;
- must_restart = 1;
-
- win:
- ;
- }
- }
- if (must_restart)
- continue;
- }
-
- if (block_drops_in[block])
- IOR_HARD_REG_SET (block_out_reg_set[block-1],
- block_stack_in[block].reg_set);
-
- block -= 1;
- }
-
- {
- /* If any reg is live at the start of the first block of a
- function, then we must guarantee that the reg holds some value by
- generating our own "load" of that register. Otherwise a 387 would
- fault trying to access an empty register. */
-
- HARD_REG_SET empty_regs;
- CLEAR_HARD_REG_SET (empty_regs);
- GO_IF_HARD_REG_SUBSET (block_stack_in[0].reg_set, empty_regs,
- no_live_regs);
- }
-
- /* Load zero into each live register. The fact that a register
- appears live at the function start does not necessarily imply an error
- in the user program: it merely means that we could not determine that
- there wasn't such an error, just as -Wunused sometimes gives
- "incorrect" warnings. In those cases, these initializations will do
- no harm.
-
- Note that we are inserting virtual register references here:
- these insns must be processed by convert_regs later. Also, these
- insns will not be in block_number, so BLOCK_NUM() will fail for them. */
-
- for (reg = LAST_STACK_REG; reg >= FIRST_STACK_REG; reg--)
- if (TEST_HARD_REG_BIT (block_stack_in[0].reg_set, reg))
- {
- rtx init_rtx;
-
- init_rtx = gen_rtx (SET, VOIDmode, FP_mode_reg[reg][(int) DFmode],
- CONST0_RTX (DFmode));
- block_begin[0] = emit_insn_after (init_rtx, first);
- PUT_MODE (block_begin[0], QImode);
-
- CLEAR_HARD_REG_BIT (block_stack_in[0].reg_set, reg);
- }
-
- no_live_regs:
- ;
-}
-\f
-/*****************************************************************************
- This section deals with stack register substitution, and forms the second
- pass over the RTL.
- *****************************************************************************/