actual_fsize = compute_frame_size (size, ®_saved);
- /* Save/setup global registers for interrupt functions right now */
+ /* Save/setup global registers for interrupt functions right now. */
if (interrupt_handler)
{
emit_insn (gen_save_interrupt ());
}
}
- /* Identify all of the saved registers */
+ /* Identify all of the saved registers. */
num_save = 0;
default_stack = 0;
for (i = 1; i < 31; i++)
if (frame_pointer_needed)
emit_move_insn (stack_pointer_rtx, hard_frame_pointer_rtx);
- /* Identify all of the saved registers */
+ /* Identify all of the saved registers. */
num_restore = 0;
default_stack = 0;
for (i = 1; i < 31; i++)
/* See if we have an insn that restores the particular registers we
want to. */
restore_all = NULL_RTX;
- if (TARGET_PROLOG_FUNCTION && num_restore > 0
+
+ if (TARGET_PROLOG_FUNCTION
+ && num_restore > 0
&& actual_fsize >= default_stack
&& !interrupt_handler)
{
if (unalloc_stack)
restore_func_len += CONST_OK_FOR_J (unalloc_stack) ? 2 : 4;
- /* see if we would have used ep to restore the registers */
+ /* See if we would have used ep to restore the registers. */
if (TARGET_EP && num_restore > 3 && (unsigned)actual_fsize < 255)
restore_normal_len = (3 * 2) + (2 * num_restore);
else
}
code = recog (restore_all, NULL_RTX, NULL_PTR);
+
if (code >= 0)
{
rtx insn;
}
/* If no epilog save function is available, restore the registers the
- old fashioned way (one by one). */
+ old fashioned way (one by one). */
if (!restore_all)
{
/* If the stack is large, we need to cut it down in 2 pieces. */
else
init_stack_free = actual_fsize;
- /* Deallocate the rest of the stack if it is > 32K or if extra stack
- was allocated for an interrupt handler that makes a call. */
- if (actual_fsize > init_stack_free
- || (interrupt_handler && actual_fsize))
+ /* Deallocate the rest of the stack if it is > 32K. */
+ if (actual_fsize > init_stack_free)
{
int diff;
diff = actual_fsize - ((interrupt_handler) ? 0 : init_stack_free);
-
+
if (CONST_OK_FOR_K (diff))
emit_insn (gen_addsi3 (stack_pointer_rtx,
stack_pointer_rtx,
}
else
{
- /* Restore registers from the beginning of the stack frame */
+ /* Restore registers from the beginning of the stack frame. */
offset = init_stack_free - 4;
/* Restore the return pointer first. */
plus_constant (stack_pointer_rtx,
offset)));
+ emit_insn (gen_rtx_USE (VOIDmode, restore_regs[i]));
offset -= 4;
}