Remove the frame size argument from function_prologue/epilogue

Message ID 878tiddvjs.fsf@linaro.org
State New
Headers show

Commit Message

Richard Sandiford Aug. 21, 2017, 11:12 a.m.
Later patches will add support for frame sizes that are a run-time
invariant but not a compile-time constant.  This then raised the
question of whether the frame size argument to the function_prologue/
epilogue hooks should be updated accordingly.

It turned out that only two targets actually used this argument, and
even they got other frame-related information from the cached machine
structure.  This patch therefore removes the argument and makes the two
targets use get_frame_size () instead.

Tested on aarch64-linux-gnu and x86_64-linux-gnu, and by building
one target per CPU and checking that there were no differences in
assembly for the testsuite.  OK to install?

Richard


2017-08-21  Richard Sandiford  <richard.sandiford@linaro.org>
	    Alan Hayward  <alan.hayward@arm.com>
	    David Sherwood  <david.sherwood@arm.com>

gcc/
	* 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.

Comments

Richard Biener Aug. 21, 2017, 12:56 p.m. | #1
On Mon, Aug 21, 2017 at 1:12 PM, Richard Sandiford
<richard.sandiford@linaro.org> wrote:
> Later patches will add support for frame sizes that are a run-time

> invariant but not a compile-time constant.  This then raised the

> question of whether the frame size argument to the function_prologue/

> epilogue hooks should be updated accordingly.

>

> It turned out that only two targets actually used this argument, and

> even they got other frame-related information from the cached machine

> structure.  This patch therefore removes the argument and makes the two

> targets use get_frame_size () instead.

>

> Tested on aarch64-linux-gnu and x86_64-linux-gnu, and by building

> one target per CPU and checking that there were no differences in

> assembly for the testsuite.  OK to install?


Ok.

RIchard.

> Richard

>

>

> 2017-08-21  Richard Sandiford  <richard.sandiford@linaro.org>

>             Alan Hayward  <alan.hayward@arm.com>

>             David Sherwood  <david.sherwood@arm.com>

>

> gcc/

>         * 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.

>

> Index: gcc/target.def

> ===================================================================

> --- gcc/target.def      2017-07-27 10:37:54.747032158 +0100

> +++ gcc/target.def      2017-08-21 11:54:34.198323780 +0100

> @@ -306,8 +306,8 @@ DEFHOOK

>  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\

> @@ -344,7 +344,7 @@ for a machine if doing so is more conven

>  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.  */

> @@ -374,7 +374,7 @@ DEFHOOK

>  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\

> @@ -414,7 +414,7 @@ functions pop their own arguments.  @cod

>  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.  */

> Index: gcc/doc/tm.texi

> ===================================================================

> --- gcc/doc/tm.texi     2017-07-27 10:37:54.477029954 +0100

> +++ gcc/doc/tm.texi     2017-08-21 11:54:34.194323780 +0100

> @@ -4582,13 +4582,13 @@ of the hook places the table of pointers

>  @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.

> @@ -4641,12 +4641,12 @@ emitted as RTL, and you have some extra

>  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.

>

> Index: gcc/final.c

> ===================================================================

> --- gcc/final.c 2017-08-10 14:36:07.457492939 +0100

> +++ gcc/final.c 2017-08-21 11:54:34.195323780 +0100

> @@ -244,8 +244,7 @@ init_final (const char *filename ATTRIBU

>     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 *)

>  {

>  }

>

> @@ -1845,7 +1844,7 @@ final_start_function (rtx_insn *first, F

>    }

>

>    /* 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.  */

> @@ -1918,7 +1917,7 @@ final_end_function (void)

>

>    /* 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))

> Index: gcc/output.h

> ===================================================================

> --- gcc/output.h        2017-07-13 09:25:13.139246592 +0100

> +++ gcc/output.h        2017-08-21 11:54:34.195323780 +0100

> @@ -355,7 +355,7 @@ extern int compute_reloc_for_constant (t

>  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);

> Index: gcc/config/arm/arm.c

> ===================================================================

> --- gcc/config/arm/arm.c        2017-08-10 14:36:08.918440167 +0100

> +++ gcc/config/arm/arm.c        2017-08-21 11:54:34.126323780 +0100

> @@ -144,8 +144,8 @@ static tree arm_handle_notshared_attribu

>  #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);

> @@ -19699,7 +19699,7 @@ arm_poke_function_name (FILE *stream, co

>  /* 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;

>

> @@ -19742,7 +19742,8 @@ arm_output_function_prologue (FILE *f, H

>

>    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,

> @@ -19757,8 +19758,7 @@ arm_output_function_prologue (FILE *f, H

>  }

>

>  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;

>

> Index: gcc/config/frv/frv.c

> ===================================================================

> --- gcc/config/frv/frv.c        2017-08-10 14:36:08.486455771 +0100

> +++ gcc/config/frv/frv.c        2017-08-21 11:54:34.127323780 +0100

> @@ -348,8 +348,8 @@ static void frv_reorg_packet                        (void);

>  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);

> @@ -1401,7 +1401,7 @@ frv_function_contains_far_jump (void)

>     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;

>

> @@ -1841,8 +1841,7 @@ frv_expand_prologue (void)

>     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;

>

> Index: gcc/config/i386/i386.c

> ===================================================================

> --- gcc/config/i386/i386.c      2017-08-21 10:42:05.840552331 +0100

> +++ gcc/config/i386/i386.c      2017-08-21 11:54:34.146323780 +0100

> @@ -15677,7 +15677,7 @@ ix86_expand_epilogue (int style)

>  /* 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 ())

> Index: gcc/config/ia64/ia64.c

> ===================================================================

> --- gcc/config/ia64/ia64.c      2017-08-10 14:36:08.784445008 +0100

> +++ gcc/config/ia64/ia64.c      2017-08-21 11:54:34.147323780 +0100

> @@ -233,8 +233,8 @@ static bool ia64_in_small_data_p (const_

>  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);

> @@ -4278,7 +4278,7 @@ ia64_assemble_integer (rtx x, unsigned i

>  /* 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;

>

> @@ -4356,8 +4356,7 @@ ia64_output_function_end_prologue (FILE

>  /* 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;

>

> Index: gcc/config/m32r/m32r.c

> ===================================================================

> --- gcc/config/m32r/m32r.c      2017-08-10 14:36:08.532454110 +0100

> +++ gcc/config/m32r/m32r.c      2017-08-21 11:54:34.148323780 +0100

> @@ -70,8 +70,8 @@ static tree  m32r_handle_model_attribute

>  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);

>

> @@ -1744,7 +1744,7 @@ m32r_expand_prologue (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);

>

> @@ -1753,7 +1753,7 @@ m32r_output_function_prologue (FILE * fi

>      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,

> @@ -1880,8 +1880,7 @@ m32r_expand_epilogue (void)

>     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;

> Index: gcc/config/microblaze/microblaze.c

> ===================================================================

> --- gcc/config/microblaze/microblaze.c  2017-08-10 14:36:08.685448583 +0100

> +++ gcc/config/microblaze/microblaze.c  2017-08-21 11:54:34.149323780 +0100

> @@ -2659,7 +2659,7 @@ save_restore_insns (int prologue)

>

>  /* 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;

> @@ -2955,8 +2955,7 @@ #define RA_MASK ((long) 0x80000000)       /* 1

>  #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;

>

> Index: gcc/config/mips/mips.c

> ===================================================================

> --- gcc/config/mips/mips.c      2017-08-10 14:36:08.949439048 +0100

> +++ gcc/config/mips/mips.c      2017-08-21 11:54:34.151323780 +0100

> @@ -11722,7 +11722,7 @@ mips_output_cplocal (void)

>  /* 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;

>

> @@ -11817,8 +11817,7 @@ mips_output_function_prologue (FILE *fil

>  /* 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;

>

> Index: gcc/config/mmix/mmix.c

> ===================================================================

> --- gcc/config/mmix/mmix.c      2017-08-10 14:36:08.995437386 +0100

> +++ gcc/config/mmix/mmix.c      2017-08-21 11:54:34.151323780 +0100

> @@ -127,9 +127,9 @@ static struct machine_function *mmix_ini

>  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);

> @@ -821,8 +821,7 @@ mmix_asm_preferred_eh_data_format (int c

>     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;

>  }

> @@ -880,8 +879,7 @@ mmix_reorg (void)

>  /* 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);

> Index: gcc/config/msp430/msp430.c

> ===================================================================

> --- gcc/config/msp430/msp430.c  2017-08-10 14:36:08.964438506 +0100

> +++ gcc/config/msp430/msp430.c  2017-08-21 11:54:34.152323780 +0100

> @@ -2059,7 +2059,7 @@ const struct attribute_spec msp430_attri

>  #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;

>

> Index: gcc/config/nds32/nds32.c

> ===================================================================

> --- gcc/config/nds32/nds32.c    2017-08-10 14:36:08.706447825 +0100

> +++ gcc/config/nds32/nds32.c    2017-08-21 11:54:34.153323780 +0100

> @@ -1502,8 +1502,7 @@ nds32_function_value_regno_p (const unsi

>  /* 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;

> @@ -1620,8 +1619,7 @@ nds32_asm_function_begin_epilogue (FILE

>  /* 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");

>  }

> Index: gcc/config/nios2/nios2.c

> ===================================================================

> --- gcc/config/nios2/nios2.c    2017-08-10 14:36:08.742446525 +0100

> +++ gcc/config/nios2/nios2.c    2017-08-21 11:54:34.154323780 +0100

> @@ -2800,7 +2800,7 @@ nios2_asm_file_end (void)

>

>  /* 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)

>      {

> Index: gcc/config/pa/pa.c

> ===================================================================

> --- gcc/config/pa/pa.c  2017-08-10 14:36:08.929439770 +0100

> +++ gcc/config/pa/pa.c  2017-08-21 11:54:34.157323780 +0100

> @@ -116,9 +116,9 @@ static void set_reg_plus_d (int, int, HO

>  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);

> @@ -3822,15 +3822,6 @@ pa_compute_frame_size (HOST_WIDE_INT siz

>           & ~(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.

> @@ -3840,7 +3831,7 @@ pa_compute_frame_size (HOST_WIDE_INT siz

>     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

> @@ -4254,7 +4245,7 @@ update_total_code_bytes (unsigned int nb

>     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;

> Index: gcc/config/powerpcspe/powerpcspe.c

> ===================================================================

> --- gcc/config/powerpcspe/powerpcspe.c  2017-08-10 14:36:08.676448909 +0100

> +++ gcc/config/powerpcspe/powerpcspe.c  2017-08-21 11:54:34.172323780 +0100

> @@ -30599,8 +30599,7 @@ rs6000_output_savres_externs (FILE *file

>  /* 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);

> @@ -31790,8 +31789,7 @@ rs6000_emit_epilogue (int sibcall)

>  /* 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 ();

> Index: gcc/config/rl78/rl78.c

> ===================================================================

> --- gcc/config/rl78/rl78.c      2017-08-10 14:36:08.971438253 +0100

> +++ gcc/config/rl78/rl78.c      2017-08-21 11:54:34.173323780 +0100

> @@ -1553,7 +1553,7 @@ #define TARGET_ASM_FUNCTION_PROLOGUE      rl7

>     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;

>

> Index: gcc/config/rs6000/rs6000.c

> ===================================================================

> --- gcc/config/rs6000/rs6000.c  2017-08-21 10:42:06.081463068 +0100

> +++ gcc/config/rs6000/rs6000.c  2017-08-21 11:54:34.182323780 +0100

> @@ -27569,8 +27569,7 @@ rs6000_output_savres_externs (FILE *file

>  /* 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);

> @@ -28694,8 +28693,7 @@ rs6000_emit_epilogue (int sibcall)

>  /* 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 ();

> Index: gcc/config/rx/rx.c

> ===================================================================

> --- gcc/config/rx/rx.c  2017-08-10 14:36:08.540453821 +0100

> +++ gcc/config/rx/rx.c  2017-08-21 11:54:34.183323780 +0100

> @@ -1888,8 +1888,7 @@ add_vector_labels (FILE *file, const cha

>  }

>

>  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");

> Index: gcc/config/sh/sh.c

> ===================================================================

> --- gcc/config/sh/sh.c  2017-08-10 14:36:08.640450209 +0100

> +++ gcc/config/sh/sh.c  2017-08-21 11:54:34.186323780 +0100

> @@ -211,7 +211,7 @@ static void sh_print_operand (FILE *, rt

>  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);

> @@ -7350,8 +7350,7 @@ sh_set_return_address (rtx ra, rtx tmp)

>

>  /* 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 *)

>  {

>  }

>

> Index: gcc/config/sparc/sparc.c

> ===================================================================

> --- gcc/config/sparc/sparc.c    2017-08-10 14:36:08.527454290 +0100

> +++ gcc/config/sparc/sparc.c    2017-08-21 11:54:34.189323780 +0100

> @@ -585,8 +585,8 @@ static rtx sparc_builtin_saveregs (void)

>  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;

> @@ -5911,7 +5911,7 @@ sparc_flat_expand_prologue (void)

>     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)

> @@ -6033,7 +6033,7 @@ sparc_can_use_return_insn_p (void)

>  /* 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
Mike Stump Aug. 22, 2017, 5:49 p.m. | #2
On Aug 21, 2017, at 4:12 AM, Richard Sandiford <richard.sandiford@linaro.org> wrote:
> 

> Later patches will add support for frame sizes that are a run-time

> invariant but not a compile-time constant.


I'm assuming dwarf and C++ exceptions will remain working.  :-)
Richard Sandiford Aug. 23, 2017, 7:54 a.m. | #3
Mike Stump <mikestump@comcast.net> writes:
> On Aug 21, 2017, at 4:12 AM, Richard Sandiford

> <richard.sandiford@linaro.org> wrote:

>> 

>> Later patches will add support for frame sizes that are a run-time

>> invariant but not a compile-time constant.

>

> I'm assuming dwarf and C++ exceptions will remain working.  :-)


Sure :-)  The vector length is represented as a DWARF pseudo register.

Patch

Index: gcc/target.def
===================================================================
--- gcc/target.def	2017-07-27 10:37:54.747032158 +0100
+++ gcc/target.def	2017-08-21 11:54:34.198323780 +0100
@@ -306,8 +306,8 @@  DEFHOOK
 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\
@@ -344,7 +344,7 @@  for a machine if doing so is more conven
 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.  */
@@ -374,7 +374,7 @@  DEFHOOK
 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\
@@ -414,7 +414,7 @@  functions pop their own arguments.  @cod
 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.  */
Index: gcc/doc/tm.texi
===================================================================
--- gcc/doc/tm.texi	2017-07-27 10:37:54.477029954 +0100
+++ gcc/doc/tm.texi	2017-08-21 11:54:34.194323780 +0100
@@ -4582,13 +4582,13 @@  of the hook places the table of pointers
 @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.
@@ -4641,12 +4641,12 @@  emitted as RTL, and you have some extra
 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.
 
Index: gcc/final.c
===================================================================
--- gcc/final.c	2017-08-10 14:36:07.457492939 +0100
+++ gcc/final.c	2017-08-21 11:54:34.195323780 +0100
@@ -244,8 +244,7 @@  init_final (const char *filename ATTRIBU
    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 *)
 {
 }
 
@@ -1845,7 +1844,7 @@  final_start_function (rtx_insn *first, F
   }
 
   /* 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.  */
@@ -1918,7 +1917,7 @@  final_end_function (void)
 
   /* 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))
Index: gcc/output.h
===================================================================
--- gcc/output.h	2017-07-13 09:25:13.139246592 +0100
+++ gcc/output.h	2017-08-21 11:54:34.195323780 +0100
@@ -355,7 +355,7 @@  extern int compute_reloc_for_constant (t
 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);
Index: gcc/config/arm/arm.c
===================================================================
--- gcc/config/arm/arm.c	2017-08-10 14:36:08.918440167 +0100
+++ gcc/config/arm/arm.c	2017-08-21 11:54:34.126323780 +0100
@@ -144,8 +144,8 @@  static tree arm_handle_notshared_attribu
 #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);
@@ -19699,7 +19699,7 @@  arm_poke_function_name (FILE *stream, co
 /* 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;
 
@@ -19742,7 +19742,8 @@  arm_output_function_prologue (FILE *f, H
 
   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,
@@ -19757,8 +19758,7 @@  arm_output_function_prologue (FILE *f, H
 }
 
 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;
 
Index: gcc/config/frv/frv.c
===================================================================
--- gcc/config/frv/frv.c	2017-08-10 14:36:08.486455771 +0100
+++ gcc/config/frv/frv.c	2017-08-21 11:54:34.127323780 +0100
@@ -348,8 +348,8 @@  static void frv_reorg_packet 			(void);
 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);
@@ -1401,7 +1401,7 @@  frv_function_contains_far_jump (void)
    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;
 
@@ -1841,8 +1841,7 @@  frv_expand_prologue (void)
    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;
 
Index: gcc/config/i386/i386.c
===================================================================
--- gcc/config/i386/i386.c	2017-08-21 10:42:05.840552331 +0100
+++ gcc/config/i386/i386.c	2017-08-21 11:54:34.146323780 +0100
@@ -15677,7 +15677,7 @@  ix86_expand_epilogue (int style)
 /* 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 ())
Index: gcc/config/ia64/ia64.c
===================================================================
--- gcc/config/ia64/ia64.c	2017-08-10 14:36:08.784445008 +0100
+++ gcc/config/ia64/ia64.c	2017-08-21 11:54:34.147323780 +0100
@@ -233,8 +233,8 @@  static bool ia64_in_small_data_p (const_
 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);
@@ -4278,7 +4278,7 @@  ia64_assemble_integer (rtx x, unsigned i
 /* 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;
 
@@ -4356,8 +4356,7 @@  ia64_output_function_end_prologue (FILE
 /* 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;
 
Index: gcc/config/m32r/m32r.c
===================================================================
--- gcc/config/m32r/m32r.c	2017-08-10 14:36:08.532454110 +0100
+++ gcc/config/m32r/m32r.c	2017-08-21 11:54:34.148323780 +0100
@@ -70,8 +70,8 @@  static tree  m32r_handle_model_attribute
 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);
 
@@ -1744,7 +1744,7 @@  m32r_expand_prologue (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);
 
@@ -1753,7 +1753,7 @@  m32r_output_function_prologue (FILE * fi
     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,
@@ -1880,8 +1880,7 @@  m32r_expand_epilogue (void)
    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;
Index: gcc/config/microblaze/microblaze.c
===================================================================
--- gcc/config/microblaze/microblaze.c	2017-08-10 14:36:08.685448583 +0100
+++ gcc/config/microblaze/microblaze.c	2017-08-21 11:54:34.149323780 +0100
@@ -2659,7 +2659,7 @@  save_restore_insns (int prologue)
 
 /* 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;
@@ -2955,8 +2955,7 @@  #define RA_MASK ((long) 0x80000000)	/* 1
 #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;
 
Index: gcc/config/mips/mips.c
===================================================================
--- gcc/config/mips/mips.c	2017-08-10 14:36:08.949439048 +0100
+++ gcc/config/mips/mips.c	2017-08-21 11:54:34.151323780 +0100
@@ -11722,7 +11722,7 @@  mips_output_cplocal (void)
 /* 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;
 
@@ -11817,8 +11817,7 @@  mips_output_function_prologue (FILE *fil
 /* 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;
 
Index: gcc/config/mmix/mmix.c
===================================================================
--- gcc/config/mmix/mmix.c	2017-08-10 14:36:08.995437386 +0100
+++ gcc/config/mmix/mmix.c	2017-08-21 11:54:34.151323780 +0100
@@ -127,9 +127,9 @@  static struct machine_function *mmix_ini
 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);
@@ -821,8 +821,7 @@  mmix_asm_preferred_eh_data_format (int c
    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;
 }
@@ -880,8 +879,7 @@  mmix_reorg (void)
 /* 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);
Index: gcc/config/msp430/msp430.c
===================================================================
--- gcc/config/msp430/msp430.c	2017-08-10 14:36:08.964438506 +0100
+++ gcc/config/msp430/msp430.c	2017-08-21 11:54:34.152323780 +0100
@@ -2059,7 +2059,7 @@  const struct attribute_spec msp430_attri
 #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;
 
Index: gcc/config/nds32/nds32.c
===================================================================
--- gcc/config/nds32/nds32.c	2017-08-10 14:36:08.706447825 +0100
+++ gcc/config/nds32/nds32.c	2017-08-21 11:54:34.153323780 +0100
@@ -1502,8 +1502,7 @@  nds32_function_value_regno_p (const unsi
 /* 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;
@@ -1620,8 +1619,7 @@  nds32_asm_function_begin_epilogue (FILE
 /* 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");
 }
Index: gcc/config/nios2/nios2.c
===================================================================
--- gcc/config/nios2/nios2.c	2017-08-10 14:36:08.742446525 +0100
+++ gcc/config/nios2/nios2.c	2017-08-21 11:54:34.154323780 +0100
@@ -2800,7 +2800,7 @@  nios2_asm_file_end (void)
 
 /* 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)
     {
Index: gcc/config/pa/pa.c
===================================================================
--- gcc/config/pa/pa.c	2017-08-10 14:36:08.929439770 +0100
+++ gcc/config/pa/pa.c	2017-08-21 11:54:34.157323780 +0100
@@ -116,9 +116,9 @@  static void set_reg_plus_d (int, int, HO
 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);
@@ -3822,15 +3822,6 @@  pa_compute_frame_size (HOST_WIDE_INT siz
 	  & ~(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.
@@ -3840,7 +3831,7 @@  pa_compute_frame_size (HOST_WIDE_INT siz
    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
@@ -4254,7 +4245,7 @@  update_total_code_bytes (unsigned int nb
    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;
Index: gcc/config/powerpcspe/powerpcspe.c
===================================================================
--- gcc/config/powerpcspe/powerpcspe.c	2017-08-10 14:36:08.676448909 +0100
+++ gcc/config/powerpcspe/powerpcspe.c	2017-08-21 11:54:34.172323780 +0100
@@ -30599,8 +30599,7 @@  rs6000_output_savres_externs (FILE *file
 /* 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);
@@ -31790,8 +31789,7 @@  rs6000_emit_epilogue (int sibcall)
 /* 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 ();
Index: gcc/config/rl78/rl78.c
===================================================================
--- gcc/config/rl78/rl78.c	2017-08-10 14:36:08.971438253 +0100
+++ gcc/config/rl78/rl78.c	2017-08-21 11:54:34.173323780 +0100
@@ -1553,7 +1553,7 @@  #define TARGET_ASM_FUNCTION_PROLOGUE	rl7
    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;
 
Index: gcc/config/rs6000/rs6000.c
===================================================================
--- gcc/config/rs6000/rs6000.c	2017-08-21 10:42:06.081463068 +0100
+++ gcc/config/rs6000/rs6000.c	2017-08-21 11:54:34.182323780 +0100
@@ -27569,8 +27569,7 @@  rs6000_output_savres_externs (FILE *file
 /* 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);
@@ -28694,8 +28693,7 @@  rs6000_emit_epilogue (int sibcall)
 /* 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 ();
Index: gcc/config/rx/rx.c
===================================================================
--- gcc/config/rx/rx.c	2017-08-10 14:36:08.540453821 +0100
+++ gcc/config/rx/rx.c	2017-08-21 11:54:34.183323780 +0100
@@ -1888,8 +1888,7 @@  add_vector_labels (FILE *file, const cha
 }
 
 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");
Index: gcc/config/sh/sh.c
===================================================================
--- gcc/config/sh/sh.c	2017-08-10 14:36:08.640450209 +0100
+++ gcc/config/sh/sh.c	2017-08-21 11:54:34.186323780 +0100
@@ -211,7 +211,7 @@  static void sh_print_operand (FILE *, rt
 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);
@@ -7350,8 +7350,7 @@  sh_set_return_address (rtx ra, rtx tmp)
 
 /* 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 *)
 {
 }
 
Index: gcc/config/sparc/sparc.c
===================================================================
--- gcc/config/sparc/sparc.c	2017-08-10 14:36:08.527454290 +0100
+++ gcc/config/sparc/sparc.c	2017-08-21 11:54:34.189323780 +0100
@@ -585,8 +585,8 @@  static rtx sparc_builtin_saveregs (void)
 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;
@@ -5911,7 +5911,7 @@  sparc_flat_expand_prologue (void)
    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)
@@ -6033,7 +6033,7 @@  sparc_can_use_return_insn_p (void)
 /* 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