+2017-08-21 Richard Sandiford <richard.sandiford@linaro.org>
+ Alan Hayward <alan.hayward@arm.com>
+ David Sherwood <david.sherwood@arm.com>
+
+ * target.def (function_prologue): Remove frame size argument.
+ (function_epilogue): Likewise.
+ * doc/tm.texi: Regenerate.
+ * final.c (final_start_function): Update call to function_prologue.
+ (final_end_function): Update call to function_epilogue.
+ (default_function_pro_epilogue): Remove frame size argument.
+ * output.h (default_function_pro_epilogue): Likewise.
+ * config/arm/arm.c (arm_output_function_epilogue): Likewise.
+ (arm_output_function_prologue): Likewise.
+ * config/frv/frv.c (frv_function_prologue): Likewise.
+ (frv_function_epilogue): Likewise.
+ * config/i386/i386.c (ix86_output_function_epilogue): Likewise.
+ * config/ia64/ia64.c (ia64_output_function_prologue): Likewise.
+ (ia64_output_function_epilogue): Likewise.
+ * config/m32r/m32r.c (m32r_output_function_prologue): Likewise.
+ (m32r_output_function_epilogue): Likewise.
+ * config/microblaze/microblaze.c (microblaze_function_prologue)
+ (microblaze_function_epilogue): Likewise.
+ * config/mips/mips.c (mips_output_function_prologue): Likewise.
+ (mips_output_function_epilogue): Likewise.
+ * config/mmix/mmix.c (mmix_target_asm_function_prologue): Likewise.
+ (mmix_target_asm_function_epilogue): Likewise.
+ * config/msp430/msp430.c (msp430_start_function): Likewise.
+ * config/nds32/nds32.c (nds32_asm_function_prologue): Likewise.
+ (nds32_asm_function_epilogue): Likewise.
+ * config/nios2/nios2.c (nios2_asm_function_prologue): Likewise.
+ * config/pa/pa.c (pa_output_function_prologue): Likewise.
+ (pa_output_function_epilogue): Likewise.
+ * config/powerpcspe/powerpcspe.c (rs6000_output_function_prologue)
+ (rs6000_output_function_epilogue): Likewise.
+ * config/rl78/rl78.c (rl78_start_function): Likewise.
+ * config/rs6000/rs6000.c (rs6000_output_function_prologue): Likewise.
+ (rs6000_output_function_epilogue): Likewise.
+ * config/rx/rx.c (rx_output_function_prologue): Likewise.
+ * config/sh/sh.c (sh_output_function_epilogue): Likewise.
+ * config/sparc/sparc.c (sparc_asm_function_prologue): Likewise.
+ (sparc_asm_function_epilogue): Likewise.
+
2017-08-21 Richard Sandiford <richard.sandiford@linaro.org>
* tree.h (type_has_mode_precision_p): New function.
#endif
static tree arm_handle_cmse_nonsecure_entry (tree *, tree, tree, int, bool *);
static tree arm_handle_cmse_nonsecure_call (tree *, tree, tree, int, bool *);
-static void arm_output_function_epilogue (FILE *, HOST_WIDE_INT);
-static void arm_output_function_prologue (FILE *, HOST_WIDE_INT);
+static void arm_output_function_epilogue (FILE *);
+static void arm_output_function_prologue (FILE *);
static int arm_comp_type_attributes (const_tree, const_tree);
static void arm_set_default_type_attributes (tree);
static int arm_adjust_cost (rtx_insn *, int, rtx_insn *, int, unsigned int);
/* Place some comments into the assembler stream
describing the current function. */
static void
-arm_output_function_prologue (FILE *f, HOST_WIDE_INT frame_size)
+arm_output_function_prologue (FILE *f)
{
unsigned long func_type;
asm_fprintf (f, "\t%@ args = %d, pretend = %d, frame = %wd\n",
crtl->args.size,
- crtl->args.pretend_args_size, frame_size);
+ crtl->args.pretend_args_size,
+ (HOST_WIDE_INT) get_frame_size ());
asm_fprintf (f, "\t%@ frame_needed = %d, uses_anonymous_args = %d\n",
frame_pointer_needed,
}
static void
-arm_output_function_epilogue (FILE *file ATTRIBUTE_UNUSED,
- HOST_WIDE_INT frame_size ATTRIBUTE_UNUSED)
+arm_output_function_epilogue (FILE *)
{
arm_stack_offsets *offsets;
static void frv_register_nop (rtx);
static void frv_reorg (void);
static void frv_pack_insns (void);
-static void frv_function_prologue (FILE *, HOST_WIDE_INT);
-static void frv_function_epilogue (FILE *, HOST_WIDE_INT);
+static void frv_function_prologue (FILE *);
+static void frv_function_epilogue (FILE *);
static bool frv_assemble_integer (rtx, unsigned, int);
static void frv_init_builtins (void);
static rtx frv_expand_builtin (tree, rtx, rtx, machine_mode, int);
will return correctly. It also does the VLIW packing. */
static void
-frv_function_prologue (FILE *file, HOST_WIDE_INT size ATTRIBUTE_UNUSED)
+frv_function_prologue (FILE *file)
{
rtx_insn *insn, *next, *last_call;
this function provides a convenient place to do cleanup. */
static void
-frv_function_epilogue (FILE *file ATTRIBUTE_UNUSED,
- HOST_WIDE_INT size ATTRIBUTE_UNUSED)
+frv_function_epilogue (FILE *)
{
frv_stack_cache = (frv_stack_t *)0;
/* Reset from the function's potential modifications. */
static void
-ix86_output_function_epilogue (FILE *file ATTRIBUTE_UNUSED, HOST_WIDE_INT)
+ix86_output_function_epilogue (FILE *file ATTRIBUTE_UNUSED)
{
if (pic_offset_table_rtx
&& !ix86_use_pseudo_pic_reg ())
static void process_epilogue (FILE *, rtx, bool, bool);
static bool ia64_assemble_integer (rtx, unsigned int, int);
-static void ia64_output_function_prologue (FILE *, HOST_WIDE_INT);
-static void ia64_output_function_epilogue (FILE *, HOST_WIDE_INT);
+static void ia64_output_function_prologue (FILE *);
+static void ia64_output_function_epilogue (FILE *);
static void ia64_output_function_end_prologue (FILE *);
static void ia64_print_operand (FILE *, rtx, int);
/* Emit the function prologue. */
static void
-ia64_output_function_prologue (FILE *file, HOST_WIDE_INT size ATTRIBUTE_UNUSED)
+ia64_output_function_prologue (FILE *file)
{
int mask, grsave, grsave_prev;
/* Emit the function epilogue. */
static void
-ia64_output_function_epilogue (FILE *file ATTRIBUTE_UNUSED,
- HOST_WIDE_INT size ATTRIBUTE_UNUSED)
+ia64_output_function_epilogue (FILE *)
{
int i;
static void m32r_print_operand (FILE *, rtx, int);
static void m32r_print_operand_address (FILE *, machine_mode, rtx);
static bool m32r_print_operand_punct_valid_p (unsigned char code);
-static void m32r_output_function_prologue (FILE *, HOST_WIDE_INT);
-static void m32r_output_function_epilogue (FILE *, HOST_WIDE_INT);
+static void m32r_output_function_prologue (FILE *);
+static void m32r_output_function_epilogue (FILE *);
static void m32r_file_start (void);
m32r_compute_frame_size which calculates the prolog size. */
static void
-m32r_output_function_prologue (FILE * file, HOST_WIDE_INT size)
+m32r_output_function_prologue (FILE * file)
{
enum m32r_function_type fn_type = m32r_compute_function_type (current_function_decl);
fprintf (file, "\t%s interrupt handler\n", ASM_COMMENT_START);
if (! current_frame_info.initialized)
- m32r_compute_frame_size (size);
+ m32r_compute_frame_size (get_frame_size ());
/* This is only for the human reader. */
fprintf (file,
and regs. */
static void
-m32r_output_function_epilogue (FILE * file ATTRIBUTE_UNUSED,
- HOST_WIDE_INT size ATTRIBUTE_UNUSED)
+m32r_output_function_epilogue (FILE *)
{
/* Reset state info for each function. */
current_frame_info = zero_frame_info;
/* Set up the stack and frame (if desired) for the function. */
static void
-microblaze_function_prologue (FILE * file, HOST_WIDE_INT size ATTRIBUTE_UNUSED)
+microblaze_function_prologue (FILE * file)
{
const char *fnname;
long fsiz = current_frame_info.total_size;
#define PIC_OFFSET_TABLE_MASK (1 << (PIC_OFFSET_TABLE_REGNUM - GP_REG_FIRST))
static void
-microblaze_function_epilogue (FILE * file ATTRIBUTE_UNUSED,
- HOST_WIDE_INT size ATTRIBUTE_UNUSED)
+microblaze_function_epilogue (FILE *file)
{
const char *fnname;
/* Implement TARGET_OUTPUT_FUNCTION_PROLOGUE. */
static void
-mips_output_function_prologue (FILE *file, HOST_WIDE_INT size ATTRIBUTE_UNUSED)
+mips_output_function_prologue (FILE *file)
{
const char *fnname;
/* Implement TARGET_OUTPUT_FUNCTION_EPILOGUE. */
static void
-mips_output_function_epilogue (FILE *file ATTRIBUTE_UNUSED,
- HOST_WIDE_INT size ATTRIBUTE_UNUSED)
+mips_output_function_epilogue (FILE *)
{
const char *fnname;
static void mmix_encode_section_info (tree, rtx, int);
static const char *mmix_strip_name_encoding (const char *);
static void mmix_emit_sp_add (HOST_WIDE_INT offset);
-static void mmix_target_asm_function_prologue (FILE *, HOST_WIDE_INT);
+static void mmix_target_asm_function_prologue (FILE *);
static void mmix_target_asm_function_end_prologue (FILE *);
-static void mmix_target_asm_function_epilogue (FILE *, HOST_WIDE_INT);
+static void mmix_target_asm_function_epilogue (FILE *);
static reg_class_t mmix_preferred_reload_class (rtx, reg_class_t);
static reg_class_t mmix_preferred_output_reload_class (rtx, reg_class_t);
static bool mmix_legitimate_address_p (machine_mode, rtx, bool);
mmix_reorg. */
static void
-mmix_target_asm_function_prologue (FILE *stream ATTRIBUTE_UNUSED,
- HOST_WIDE_INT framesize ATTRIBUTE_UNUSED)
+mmix_target_asm_function_prologue (FILE *)
{
cfun->machine->in_prologue = 1;
}
/* TARGET_ASM_FUNCTION_EPILOGUE. */
static void
-mmix_target_asm_function_epilogue (FILE *stream,
- HOST_WIDE_INT locals_size ATTRIBUTE_UNUSED)
+mmix_target_asm_function_epilogue (FILE *stream)
{
/* Emit an \n for readability of the generated assembly. */
fputc ('\n', stream);
#define TARGET_ASM_FUNCTION_PROLOGUE msp430_start_function
static void
-msp430_start_function (FILE *outfile, HOST_WIDE_INT hwi_local ATTRIBUTE_UNUSED)
+msp430_start_function (FILE *outfile)
{
int r, n;
/* The content produced from this function
will be placed before prologue body. */
static void
-nds32_asm_function_prologue (FILE *file,
- HOST_WIDE_INT size ATTRIBUTE_UNUSED)
+nds32_asm_function_prologue (FILE *file)
{
int r;
const char *func_name;
/* The content produced from this function
will be placed after epilogue body. */
static void
-nds32_asm_function_epilogue (FILE *file,
- HOST_WIDE_INT size ATTRIBUTE_UNUSED)
+nds32_asm_function_epilogue (FILE *file)
{
fprintf (file, "\t! END EPILOGUE\n");
}
/* Implement TARGET_ASM_FUNCTION_PROLOGUE. */
static void
-nios2_asm_function_prologue (FILE *file, HOST_WIDE_INT size ATTRIBUTE_UNUSED)
+nios2_asm_function_prologue (FILE *file)
{
if (flag_verbose_asm || flag_debug_asm)
{
static rtx pa_function_value (const_tree, const_tree, bool);
static rtx pa_libcall_value (machine_mode, const_rtx);
static bool pa_function_value_regno_p (const unsigned int);
-static void pa_output_function_prologue (FILE *, HOST_WIDE_INT);
+static void pa_output_function_prologue (FILE *);
static void update_total_code_bytes (unsigned int);
-static void pa_output_function_epilogue (FILE *, HOST_WIDE_INT);
+static void pa_output_function_epilogue (FILE *);
static int pa_adjust_cost (rtx_insn *, int, rtx_insn *, int, unsigned int);
static int pa_adjust_priority (rtx_insn *, int);
static int pa_issue_rate (void);
& ~(PREFERRED_STACK_BOUNDARY / BITS_PER_UNIT - 1));
}
-/* Generate the assembly code for function entry. FILE is a stdio
- stream to output the code to. SIZE is an int: how many units of
- temporary storage to allocate.
-
- Refer to the array `regs_ever_live' to determine which registers to
- save; `regs_ever_live[I]' is nonzero if register number I is ever
- used in the function. This function is responsible for knowing
- which registers should not be saved even if used. */
-
/* On HP-PA, move-double insns between fpu and cpu need an 8-byte block
of memory. If any fpu reg is used in the function, we allocate
such a block here, at the bottom of the frame, just in case it's needed.
to do this is made in regclass.c. */
static void
-pa_output_function_prologue (FILE *file, HOST_WIDE_INT size ATTRIBUTE_UNUSED)
+pa_output_function_prologue (FILE *file)
{
/* The function's label and associated .PROC must never be
separated and must be output *after* any profiling declarations
adjustments before returning. */
static void
-pa_output_function_epilogue (FILE *file, HOST_WIDE_INT size ATTRIBUTE_UNUSED)
+pa_output_function_epilogue (FILE *file)
{
rtx_insn *insn = get_last_insn ();
bool extra_nop;
/* Write function prologue. */
static void
-rs6000_output_function_prologue (FILE *file,
- HOST_WIDE_INT size ATTRIBUTE_UNUSED)
+rs6000_output_function_prologue (FILE *file)
{
if (!cfun->is_thunk)
rs6000_output_savres_externs (file);
/* Write function epilogue. */
static void
-rs6000_output_function_epilogue (FILE *file,
- HOST_WIDE_INT size ATTRIBUTE_UNUSED)
+rs6000_output_function_epilogue (FILE *file)
{
#if TARGET_MACHO
macho_branch_islands ();
this to insert a comment in the asm file describing the
function. */
static void
-rl78_start_function (FILE *file, HOST_WIDE_INT hwi_local ATTRIBUTE_UNUSED)
+rl78_start_function (FILE *file)
{
int i;
/* Write function prologue. */
static void
-rs6000_output_function_prologue (FILE *file,
- HOST_WIDE_INT size ATTRIBUTE_UNUSED)
+rs6000_output_function_prologue (FILE *file)
{
if (!cfun->is_thunk)
rs6000_output_savres_externs (file);
/* Write function epilogue. */
static void
-rs6000_output_function_epilogue (FILE *file,
- HOST_WIDE_INT size ATTRIBUTE_UNUSED)
+rs6000_output_function_epilogue (FILE *file)
{
#if TARGET_MACHO
macho_branch_islands ();
}
static void
-rx_output_function_prologue (FILE * file,
- HOST_WIDE_INT frame_size ATTRIBUTE_UNUSED)
+rx_output_function_prologue (FILE * file)
{
add_vector_labels (file, "interrupt");
add_vector_labels (file, "vector");
static void sh_print_operand_address (FILE *, machine_mode, rtx);
static bool sh_print_operand_punct_valid_p (unsigned char code);
static bool sh_asm_output_addr_const_extra (FILE *file, rtx x);
-static void sh_output_function_epilogue (FILE *, HOST_WIDE_INT);
+static void sh_output_function_epilogue (FILE *);
static void sh_insert_attributes (tree, tree *);
static const char *sh_check_pch_target_flags (int);
static int sh_register_move_cost (machine_mode, reg_class_t, reg_class_t);
/* Clear variables at function end. */
static void
-sh_output_function_epilogue (FILE *file ATTRIBUTE_UNUSED,
- HOST_WIDE_INT size ATTRIBUTE_UNUSED)
+sh_output_function_epilogue (FILE *)
{
}
static int epilogue_renumber (rtx *, int);
static bool sparc_assemble_integer (rtx, unsigned int, int);
static int set_extends (rtx_insn *);
-static void sparc_asm_function_prologue (FILE *, HOST_WIDE_INT);
-static void sparc_asm_function_epilogue (FILE *, HOST_WIDE_INT);
+static void sparc_asm_function_prologue (FILE *);
+static void sparc_asm_function_epilogue (FILE *);
#ifdef TARGET_SOLARIS
static void sparc_solaris_elf_asm_named_section (const char *, unsigned int,
tree) ATTRIBUTE_UNUSED;
down to emitting the necessary .register directives. */
static void
-sparc_asm_function_prologue (FILE *file, HOST_WIDE_INT size ATTRIBUTE_UNUSED)
+sparc_asm_function_prologue (FILE *file)
{
/* Check that the assumption we made in sparc_expand_prologue is valid. */
if (!TARGET_FLAT)
/* This function generates the assembly code for function exit. */
static void
-sparc_asm_function_epilogue (FILE *file, HOST_WIDE_INT size ATTRIBUTE_UNUSED)
+sparc_asm_function_epilogue (FILE *file)
{
/* If the last two instructions of a function are "call foo; dslot;"
the return address might point to the first instruction in the next
@code{__patchable_function_entries}.
@end deftypefn
-@deftypefn {Target Hook} void TARGET_ASM_FUNCTION_PROLOGUE (FILE *@var{file}, HOST_WIDE_INT @var{size})
+@deftypefn {Target Hook} void TARGET_ASM_FUNCTION_PROLOGUE (FILE *@var{file})
If defined, a function that outputs the assembler code for entry to a
function. The prologue is responsible for setting up the stack frame,
initializing the frame pointer register, saving registers that must be
saved, and allocating @var{size} additional bytes of storage for the
-local variables. @var{size} is an integer. @var{file} is a stdio
-stream to which the assembler code should be output.
+local variables. @var{file} is a stdio stream to which the assembler
+code should be output.
The label for the beginning of the function need not be output by this
macro. That has already been done when the macro is run.
emitted. @xref{epilogue instruction pattern}.
@end deftypefn
-@deftypefn {Target Hook} void TARGET_ASM_FUNCTION_EPILOGUE (FILE *@var{file}, HOST_WIDE_INT @var{size})
+@deftypefn {Target Hook} void TARGET_ASM_FUNCTION_EPILOGUE (FILE *@var{file})
If defined, a function that outputs the assembler code for exit from a
function. The epilogue is responsible for restoring the saved
registers and stack pointer to their values when the function was
called, and returning control to the caller. This macro takes the
-same arguments as the macro @code{TARGET_ASM_FUNCTION_PROLOGUE}, and the
+same argument as the macro @code{TARGET_ASM_FUNCTION_PROLOGUE}, and the
registers to restore are determined from @code{regs_ever_live} and
@code{CALL_USED_REGISTERS} in the same way.
If not overridden for epilogue code, then the function body itself
contains return instructions wherever needed. */
void
-default_function_pro_epilogue (FILE *file ATTRIBUTE_UNUSED,
- HOST_WIDE_INT size ATTRIBUTE_UNUSED)
+default_function_pro_epilogue (FILE *)
{
}
}
/* First output the function prologue: code to set up the stack frame. */
- targetm.asm_out.function_prologue (file, get_frame_size ());
+ targetm.asm_out.function_prologue (file);
/* If the machine represents the prologue as RTL, the profiling code must
be emitted when NOTE_INSN_PROLOGUE_END is scanned. */
/* Finally, output the function epilogue:
code to restore the stack frame and return to the caller. */
- targetm.asm_out.function_epilogue (asm_out_file, get_frame_size ());
+ targetm.asm_out.function_epilogue (asm_out_file);
/* And debug output. */
if (!DECL_IGNORED_P (current_function_decl))
extern const char *user_label_prefix;
/* Default target function prologue and epilogue assembler output. */
-extern void default_function_pro_epilogue (FILE *, HOST_WIDE_INT);
+extern void default_function_pro_epilogue (FILE *);
/* Default target function switched text sections. */
extern void default_function_switched_text_sections (FILE *, tree, bool);
function. The prologue is responsible for setting up the stack frame,\n\
initializing the frame pointer register, saving registers that must be\n\
saved, and allocating @var{size} additional bytes of storage for the\n\
-local variables. @var{size} is an integer. @var{file} is a stdio\n\
-stream to which the assembler code should be output.\n\
+local variables. @var{file} is a stdio stream to which the assembler\n\
+code should be output.\n\
\n\
The label for the beginning of the function need not be output by this\n\
macro. That has already been done when the macro is run.\n\
compatibility reasons. Except in cases where required by standard\n\
or by a debugger, there is no reason why the stack layout used by GCC\n\
need agree with that used by other compilers for a machine.",
- void, (FILE *file, HOST_WIDE_INT size),
+ void, (FILE *file),
default_function_pro_epilogue)
/* Output the assembler code for end of prologue. */
function. The epilogue is responsible for restoring the saved\n\
registers and stack pointer to their values when the function was\n\
called, and returning control to the caller. This macro takes the\n\
-same arguments as the macro @code{TARGET_ASM_FUNCTION_PROLOGUE}, and the\n\
+same argument as the macro @code{TARGET_ASM_FUNCTION_PROLOGUE}, and the\n\
registers to restore are determined from @code{regs_ever_live} and\n\
@code{CALL_USED_REGISTERS} in the same way.\n\
\n\
needs to know what was decided. The number of bytes of the current\n\
function's arguments that this function should pop is available in\n\
@code{crtl->args.pops_args}. @xref{Scalar Return}.",
- void, (FILE *file, HOST_WIDE_INT size),
+ void, (FILE *file),
default_function_pro_epilogue)
/* Initialize target-specific sections. */