From: Richard Sandiford Date: Mon, 21 Aug 2017 14:51:52 +0000 (+0000) Subject: Remove the frame size argument from function_prologue/epilogue X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=427764163985bbfb309ee43a85605d6b32c225d5;p=gcc.git Remove the frame size argument from function_prologue/epilogue 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. 2017-08-21 Richard Sandiford Alan Hayward David Sherwood 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. Co-Authored-By: Alan Hayward Co-Authored-By: David Sherwood From-SVN: r251232 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e7d4e16df59..4c0b975e26a 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,45 @@ +2017-08-21 Richard Sandiford + Alan Hayward + David Sherwood + + * 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 * tree.h (type_has_mode_precision_p): New function. diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index fa3e2fa6c76..3d15a8185a7 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -144,8 +144,8 @@ static tree arm_handle_notshared_attribute (tree *, tree, tree, int, bool *); #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, const char *name) /* 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, HOST_WIDE_INT frame_size) 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, HOST_WIDE_INT frame_size) } 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; diff --git a/gcc/config/frv/frv.c b/gcc/config/frv/frv.c index 1cdbaa81c8d..2697ba978df 100644 --- a/gcc/config/frv/frv.c +++ b/gcc/config/frv/frv.c @@ -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; diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index e67f6412acd..3c82ae64f4f 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -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 ()) diff --git a/gcc/config/ia64/ia64.c b/gcc/config/ia64/ia64.c index 79c323f67ee..571c2043022 100644 --- a/gcc/config/ia64/ia64.c +++ b/gcc/config/ia64/ia64.c @@ -233,8 +233,8 @@ static bool ia64_in_small_data_p (const_tree); 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 int size, int aligned_p) /* 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 *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; diff --git a/gcc/config/m32r/m32r.c b/gcc/config/m32r/m32r.c index d7893d7550a..ae373882378 100644 --- a/gcc/config/m32r/m32r.c +++ b/gcc/config/m32r/m32r.c @@ -70,8 +70,8 @@ static tree m32r_handle_model_attribute (tree *, tree, tree, int, bool *); 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 * file, HOST_WIDE_INT size) 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; diff --git a/gcc/config/microblaze/microblaze.c b/gcc/config/microblaze/microblaze.c index 2cdd24056a5..04121c816ed 100644 --- a/gcc/config/microblaze/microblaze.c +++ b/gcc/config/microblaze/microblaze.c @@ -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 @@ microblaze_expand_prologue (void) #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; diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c index d2737a6ee80..563f74b74f0 100644 --- a/gcc/config/mips/mips.c +++ b/gcc/config/mips/mips.c @@ -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 *file, HOST_WIDE_INT size ATTRIBUTE_UNUSED) /* 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; diff --git a/gcc/config/mmix/mmix.c b/gcc/config/mmix/mmix.c index 6ca2fd9441c..c2cef018e3f 100644 --- a/gcc/config/mmix/mmix.c +++ b/gcc/config/mmix/mmix.c @@ -127,9 +127,9 @@ static struct machine_function *mmix_init_machine_status (void); 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 code ATTRIBUTE_UNUSED, 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); diff --git a/gcc/config/msp430/msp430.c b/gcc/config/msp430/msp430.c index 1ab79a722ed..2b4427d8eb2 100644 --- a/gcc/config/msp430/msp430.c +++ b/gcc/config/msp430/msp430.c @@ -2059,7 +2059,7 @@ const struct attribute_spec msp430_attribute_table[] = #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; diff --git a/gcc/config/nds32/nds32.c b/gcc/config/nds32/nds32.c index 14310de8672..48344ddb4b3 100644 --- a/gcc/config/nds32/nds32.c +++ b/gcc/config/nds32/nds32.c @@ -1502,8 +1502,7 @@ nds32_function_value_regno_p (const unsigned int regno) /* 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 *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"); } diff --git a/gcc/config/nios2/nios2.c b/gcc/config/nios2/nios2.c index 884b1dc367e..0a4ce388614 100644 --- a/gcc/config/nios2/nios2.c +++ b/gcc/config/nios2/nios2.c @@ -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) { diff --git a/gcc/config/pa/pa.c b/gcc/config/pa/pa.c index 52f76cfd5f1..071cdb521ed 100644 --- a/gcc/config/pa/pa.c +++ b/gcc/config/pa/pa.c @@ -116,9 +116,9 @@ static void set_reg_plus_d (int, int, HOST_WIDE_INT, int); 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 size, int *fregs_live) & ~(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 size, int *fregs_live) 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 nbytes) 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; diff --git a/gcc/config/powerpcspe/powerpcspe.c b/gcc/config/powerpcspe/powerpcspe.c index f2840894fc1..5a92cd09069 100644 --- a/gcc/config/powerpcspe/powerpcspe.c +++ b/gcc/config/powerpcspe/powerpcspe.c @@ -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 (); diff --git a/gcc/config/rl78/rl78.c b/gcc/config/rl78/rl78.c index f93116230d5..9592cd9ecb9 100644 --- a/gcc/config/rl78/rl78.c +++ b/gcc/config/rl78/rl78.c @@ -1553,7 +1553,7 @@ rl78_expand_eh_epilogue (rtx x ATTRIBUTE_UNUSED) 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; diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index 5e694ffffe1..c0e3dcaefb7 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -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 (); diff --git a/gcc/config/rx/rx.c b/gcc/config/rx/rx.c index daae27b404a..9852a736471 100644 --- a/gcc/config/rx/rx.c +++ b/gcc/config/rx/rx.c @@ -1888,8 +1888,7 @@ add_vector_labels (FILE *file, const char *aname) } 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"); diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c index c31776ffef8..90dd76df05f 100644 --- a/gcc/config/sh/sh.c +++ b/gcc/config/sh/sh.c @@ -211,7 +211,7 @@ static void sh_print_operand (FILE *, rtx, int); 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 *) { } diff --git a/gcc/config/sparc/sparc.c b/gcc/config/sparc/sparc.c index d494ecf2410..911cb34c22b 100644 --- a/gcc/config/sparc/sparc.c +++ b/gcc/config/sparc/sparc.c @@ -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 diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi index 23e85c7afea..20926d1b2fc 100644 --- a/gcc/doc/tm.texi +++ b/gcc/doc/tm.texi @@ -4582,13 +4582,13 @@ of the hook places the table of pointers in the special section named @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 assembler that needs to be 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. diff --git a/gcc/final.c b/gcc/final.c index ad999f77fdd..5cc0a1ebbc9 100644 --- a/gcc/final.c +++ b/gcc/final.c @@ -244,8 +244,7 @@ init_final (const char *filename ATTRIBUTE_UNUSED) 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, FILE *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. */ @@ -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)) diff --git a/gcc/output.h b/gcc/output.h index 7a93fa89cab..2ea43667192 100644 --- a/gcc/output.h +++ b/gcc/output.h @@ -355,7 +355,7 @@ extern int compute_reloc_for_constant (tree); 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); diff --git a/gcc/target.def b/gcc/target.def index 6d67b1fe8ba..985ddc0c870 100644 --- a/gcc/target.def +++ b/gcc/target.def @@ -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 convenient or required for\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. */ @@ -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. @code{TARGET_ASM_FUNCTION_EPILOGUE}\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. */