+ insn = chain->insn;
+ next = chain->next;
+ if (!CALL_P (insn)
+ || find_reg_note (insn, REG_NORETURN, NULL))
+ continue;
+ freq = REG_FREQ_FROM_BB (BLOCK_FOR_INSN (insn));
+ REG_SET_TO_HARD_REG_SET (hard_regs_to_save,
+ &chain->live_throughout);
+ used_regs = insn_callee_abi (insn).full_reg_clobbers ();
+ /* ??? This preserves traditional behavior; it might not be needed. */
+ used_regs |= fixed_reg_set;
+
+ /* Record all registers set in this call insn. These don't
+ need to be saved. N.B. the call insn might set a subreg
+ of a multi-hard-reg pseudo; then the pseudo is considered
+ live during the call, but the subreg that is set
+ isn't. */
+ CLEAR_HARD_REG_SET (this_insn_sets);
+ note_stores (insn, mark_set_regs, &this_insn_sets);
+ /* Sibcalls are considered to set the return value. */
+ if (SIBLING_CALL_P (insn) && crtl->return_rtx)
+ mark_set_regs (crtl->return_rtx, NULL_RTX, &this_insn_sets);
+
+ used_regs &= ~(fixed_reg_set | this_insn_sets);
+ hard_regs_to_save &= used_regs & savable_regs;
+ for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++)
+ if (TEST_HARD_REG_BIT (hard_regs_to_save, regno))
+ {
+ if (hard_reg_map[regno] != NULL)
+ hard_reg_map[regno]->call_freq += freq;
+ else
+ new_saved_hard_reg (regno, freq);
+ SET_HARD_REG_BIT (hard_regs_used, regno);
+ }
+ cheap = find_reg_note (insn, REG_RETURNED, NULL);
+ if (cheap)
+ cheap = XEXP (cheap, 0);
+ /* Look through all live pseudos, mark their hard registers. */
+ EXECUTE_IF_SET_IN_REG_SET
+ (&chain->live_throughout, FIRST_PSEUDO_REGISTER, regno, rsi)