if (set)
CLEAR_HARD_REG_SET (*set);
count = 0;
+
+ /* No need to save any registers if the function never returns. */
+ if (TREE_THIS_VOLATILE (current_function_decl))
+ return 0;
+
for (reg = 0; reg < 32; reg++)
{
/* Do not push/pop __tmp_reg__, __zero_reg__, as well as
int main_p;
int live_seq;
int minimize;
-
+
+ last_insn_address = 0;
+ jump_tables_size = 0;
+ prologue_size = 0;
+ fprintf (file, "/* prologue: frame size=%d */\n", size);
+
if (avr_naked_function_p (current_function_decl))
{
- fprintf (file, "/* prologue: naked */\n");
- return;
+ fputs ("/* prologue: naked */\n", file);
+ goto out;
}
interrupt_func_p = interrupt_function_p (current_function_decl);
minimize = (TARGET_CALL_PROLOGUES
&& !interrupt_func_p && !signal_func_p && live_seq);
- last_insn_address = 0;
- jump_tables_size = 0;
- prologue_size = 0;
- fprintf (file, "/* prologue: frame size=%d */\n", size);
-
if (interrupt_func_p)
{
fprintf (file,"\tsei\n");
}
}
}
+
+ out:
fprintf (file, "/* prologue end (size=%d) */\n", prologue_size);
}
int function_size;
int live_seq;
int minimize;
+ rtx last = get_last_nonnote_insn ();
+
+ function_size = jump_tables_size;
+ if (last)
+ {
+ rtx first = get_first_nonnote_insn ();
+ function_size += (INSN_ADDRESSES (INSN_UID (last)) -
+ INSN_ADDRESSES (INSN_UID (first)));
+ function_size += get_attr_length (last);
+ }
+
+ fprintf (file, "/* epilogue: frame size=%d */\n", size);
+ epilogue_size = 0;
if (avr_naked_function_p (current_function_decl))
{
- fprintf (file, "/* epilogue: naked */\n");
- return;
+ fputs ("/* epilogue: naked */\n", file);
+ goto out;
+ }
+
+ if (last && GET_CODE (last) == BARRIER)
+ {
+ fputs ("/* epilogue: noreturn */\n", file);
+ goto out;
}
interrupt_func_p = interrupt_function_p (current_function_decl);
signal_func_p = signal_function_p (current_function_decl);
main_p = MAIN_NAME_P (DECL_NAME (current_function_decl));
- function_size = (INSN_ADDRESSES (INSN_UID (get_last_nonnote_insn ()))
- - INSN_ADDRESSES (INSN_UID (get_first_nonnote_insn ())));
- function_size += jump_tables_size;
live_seq = sequent_regs_live ();
minimize = (TARGET_CALL_PROLOGUES
&& !interrupt_func_p && !signal_func_p && live_seq);
- epilogue_size = 0;
- fprintf (file, "/* epilogue: frame size=%d */\n", size);
if (main_p)
{
/* Return value from main() is already in the correct registers
fprintf (file, "\tret\n");
++epilogue_size;
}
-
+
+ out:
fprintf (file, "/* epilogue end (size=%d) */\n", epilogue_size);
fprintf (file, "/* function %s size %d (%d) */\n", current_function_name,
prologue_size + function_size + epilogue_size, function_size);