===================================================================
@@ -499,6 +499,8 @@
false },
{ "brk_interrupt", 0, 0, true, false, false, rl78_handle_func_attribute,
false },
+ { "naked", 0, 0, true, false, false, rl78_handle_func_attribute,
+ false },
{ NULL, 0, 0, false, false, false, NULL, false }
};
@@ -825,6 +827,12 @@
return rv;
}
+static int
+rl78_is_naked_func (void)
+{
+ return (lookup_attribute ("naked", DECL_ATTRIBUTES (current_function_decl)) != NULL_TREE);
+}
+
/* Expand the function prologue (from the prologue pattern). */
void
rl78_expand_prologue (void)
@@ -833,6 +841,9 @@
rtx sp = gen_rtx_REG (HImode, STACK_POINTER_REGNUM);
int rb = 0;
+ if (rl78_is_naked_func ())
+ return;
+
if (!cfun->machine->computed)
rl78_compute_frame_info ();
@@ -877,6 +888,9 @@
rtx sp = gen_rtx_REG (HImode, STACK_POINTER_REGNUM);
int rb = 0;
+ if (rl78_is_naked_func ())
+ return;
+
if (frame_pointer_needed)
{
emit_move_insn (gen_rtx_REG (HImode, STACK_POINTER_REGNUM),
===================================================================
@@ -3142,7 +3142,7 @@
@item naked
@cindex function without a prologue/epilogue code
-Use this attribute on the ARM, AVR, MCORE, RX and SPU ports to indicate that
+Use this attribute on the ARM, AVR, MCORE, RL78, RX and SPU ports to indicate that
the specified function does not need prologue/epilogue sequences generated by
the compiler. It is up to the programmer to provide these sequences. The
only statements that can be safely included in naked functions are