diff --git a/gcc/config/aarch64/aarch64.cc b/gcc/config/aarch64/aarch64.cc index d0376837ab7ddcabbb14648825adecbac117da57..d0f31cb6b8bde36615ee99aa5f8c7b913ccb7853 100644 --- a/gcc/config/aarch64/aarch64.cc +++ b/gcc/config/aarch64/aarch64.cc @@ -24207,7 +24207,7 @@ aarch64_declare_function_name (FILE *stream, const char* name, /* Don't forget the type directive for ELF. */ ASM_OUTPUT_TYPE_DIRECTIVE (stream, name, "function"); - ASM_OUTPUT_LABEL (stream, name); + ASM_OUTPUT_FUNCTION_LABEL (stream, name, fndecl); cfun->machine->label_is_assembled = true; } diff --git a/gcc/config/alpha/alpha.cc b/gcc/config/alpha/alpha.cc index b540e4fadfc8db2156abd82cf82032852418907d..98df142fb061ece7f768fcad6c4878682dbb65f4 100644 --- a/gcc/config/alpha/alpha.cc +++ b/gcc/config/alpha/alpha.cc @@ -7986,8 +7986,7 @@ int num_source_filenames = 0; /* Output the textual info surrounding the prologue. */ void -alpha_start_function (FILE *file, const char *fnname, - tree decl ATTRIBUTE_UNUSED) +alpha_start_function (FILE *file, const char *fnname, tree decl) { unsigned long imask, fmask; /* Complete stack size needed. */ @@ -8052,7 +8051,7 @@ alpha_start_function (FILE *file, const char *fnname, if (TARGET_ABI_OPEN_VMS) strcat (entry_label, "..en"); - ASM_OUTPUT_LABEL (file, entry_label); + ASM_OUTPUT_FUNCTION_LABEL (file, entry_label, decl); inside_function = TRUE; if (TARGET_ABI_OPEN_VMS) diff --git a/gcc/config/arm/aout.h b/gcc/config/arm/aout.h index b3f2dbdf70d926b03a3f2931b034795d95ebb26a..db9e8ddfd7043f17a6e032670f351a4547617bc2 100644 --- a/gcc/config/arm/aout.h +++ b/gcc/config/arm/aout.h @@ -152,7 +152,7 @@ do \ { \ ARM_DECLARE_FUNCTION_NAME (STREAM, NAME, DECL); \ - ASM_OUTPUT_LABEL (STREAM, NAME); \ + ASM_OUTPUT_FUNCTION_LABEL (STREAM, NAME, DECL); \ } \ while (0) #endif diff --git a/gcc/config/arm/arm.cc b/gcc/config/arm/arm.cc index a14b86a1d331b0bd8962ea3bdf5cfeb390324468..e5a944486d7bd583627b0e22dfe8f95862e975bb 100644 --- a/gcc/config/arm/arm.cc +++ b/gcc/config/arm/arm.cc @@ -21800,7 +21800,7 @@ arm_asm_declare_function_name (FILE *file, const char *name, tree decl) ARM_DECLARE_FUNCTION_NAME (file, name, decl); ASM_OUTPUT_TYPE_DIRECTIVE (file, name, "function"); ASM_DECLARE_RESULT (file, DECL_RESULT (decl)); - ASM_OUTPUT_LABEL (file, name); + ASM_OUTPUT_FUNCTION_LABEL (file, name, decl); if (cmse_name) ASM_OUTPUT_LABEL (file, cmse_name); diff --git a/gcc/config/bfin/bfin.h b/gcc/config/bfin/bfin.h index 7977ed70cd38f13dcdf2e06135629b311c44918b..e6ac8e3206cd586c205cbbd32d36117f82eaae26 100644 --- a/gcc/config/bfin/bfin.h +++ b/gcc/config/bfin/bfin.h @@ -995,14 +995,14 @@ typedef enum directives { fputc ('\n',FILE); \ } while (0) -#define ASM_DECLARE_FUNCTION_NAME(FILE,NAME,DECL) \ - do { \ - fputs (".type ", FILE); \ - assemble_name (FILE, NAME); \ - fputs (", STT_FUNC", FILE); \ - fputc (';',FILE); \ - fputc ('\n',FILE); \ - ASM_OUTPUT_LABEL(FILE, NAME); \ +#define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \ + do { \ + fputs (".type ", FILE); \ + assemble_name (FILE, NAME); \ + fputs (", STT_FUNC", FILE); \ + fputc (';', FILE); \ + fputc ('\n', FILE); \ + ASM_OUTPUT_FUNCTION_LABEL (FILE, NAME, DECL); \ } while (0) #define ASM_OUTPUT_LABEL(FILE, NAME) \ diff --git a/gcc/config/c6x/c6x.h b/gcc/config/c6x/c6x.h index f65420dfa6e46c300f74147f4fa3c0e6c6f43b47..1b16ff5e3372242832f0c0cb9e23258e456c4c6a 100644 --- a/gcc/config/c6x/c6x.h +++ b/gcc/config/c6x/c6x.h @@ -459,7 +459,7 @@ struct GTY(()) machine_function c6x_output_file_unwind (FILE); \ ASM_OUTPUT_TYPE_DIRECTIVE (FILE, NAME, "function"); \ ASM_DECLARE_RESULT (FILE, DECL_RESULT (DECL)); \ - ASM_OUTPUT_LABEL (FILE, NAME); \ + ASM_OUTPUT_FUNCTION_LABEL (FILE, NAME, DECL); \ } \ while (0) diff --git a/gcc/config/gcn/gcn.cc b/gcc/config/gcn/gcn.cc index b8c107aca76912d89bcab003702879a3307e9665..79d3a65ce136f90ff7db6363d5db71852c5f6e42 100644 --- a/gcc/config/gcn/gcn.cc +++ b/gcc/config/gcn/gcn.cc @@ -6555,7 +6555,7 @@ output_file_start (void) comments that pass information to mkoffload. */ void -gcn_hsa_declare_function_name (FILE *file, const char *name, tree) +gcn_hsa_declare_function_name (FILE *file, const char *name, tree decl) { int sgpr, vgpr, avgpr; bool xnack_enabled = TARGET_XNACK; @@ -6716,8 +6716,7 @@ gcn_hsa_declare_function_name (FILE *file, const char *name, tree) fputs ("\t.type\t", file); assemble_name (file, name); fputs (",@function\n", file); - assemble_name (file, name); - fputs (":\n", file); + ASM_OUTPUT_FUNCTION_LABEL (file, name, decl); /* This comment is read by mkoffload. */ if (flag_openacc) diff --git a/gcc/config/h8300/h8300.h b/gcc/config/h8300/h8300.h index aa949618f1cc92c4fd46826605869e802888aa58..bb0bf7404e0f6722194f9cb66abc9f131411da4d 100644 --- a/gcc/config/h8300/h8300.h +++ b/gcc/config/h8300/h8300.h @@ -650,7 +650,7 @@ struct cum_arg #define GLOBAL_ASM_OP "\t.global " #define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \ - ASM_OUTPUT_LABEL (FILE, NAME) + ASM_OUTPUT_FUNCTION_LABEL (FILE, NAME, DECL) /* This is how to store into the string LABEL the symbol_ref name of an internal numbered label where diff --git a/gcc/config/ia64/ia64.cc b/gcc/config/ia64/ia64.cc index 5fb2a41e043edf9e6ee49f2f88cab478cc48d485..53a4444d03b2fcfc1c2f53c4f6a0771c67d3f778 100644 --- a/gcc/config/ia64/ia64.cc +++ b/gcc/config/ia64/ia64.cc @@ -3886,8 +3886,7 @@ ia64_expand_prologue (void) /* Output the textual info surrounding the prologue. */ void -ia64_start_function (FILE *file, const char *fnname, - tree decl ATTRIBUTE_UNUSED) +ia64_start_function (FILE *file, const char *fnname, tree decl) { #if TARGET_ABI_OPEN_VMS vms_start_function (fnname); @@ -3896,7 +3895,7 @@ ia64_start_function (FILE *file, const char *fnname, fputs ("\t.proc ", file); assemble_name (file, fnname); fputc ('\n', file); - ASM_OUTPUT_LABEL (file, fnname); + ASM_OUTPUT_FUNCTION_LABEL (file, fnname, decl); } /* Called after register allocation to add any instructions needed for the diff --git a/gcc/config/mcore/mcore-elf.h b/gcc/config/mcore/mcore-elf.h index f89fe7c0f8fd0fb90deb50d17fec4c7860b4efe1..6c522c7a5ac65f3df07d5c9a57f2bb48aafcf9a1 100644 --- a/gcc/config/mcore/mcore-elf.h +++ b/gcc/config/mcore/mcore-elf.h @@ -51,7 +51,7 @@ along with GCC; see the file COPYING3. If not see } \ ASM_OUTPUT_TYPE_DIRECTIVE (FILE, NAME, "function"); \ ASM_DECLARE_RESULT (FILE, DECL_RESULT (DECL)); \ - ASM_OUTPUT_LABEL (FILE, NAME); \ + ASM_OUTPUT_FUNCTION_LABEL (FILE, NAME, DECL); \ } \ while (0) diff --git a/gcc/config/microblaze/microblaze.cc b/gcc/config/microblaze/microblaze.cc index e5aeb49af88f3e5f7827541b8527ec75f4db5160..98ec6116ffda1664ba7d6f43f9070b49a1ef25d4 100644 --- a/gcc/config/microblaze/microblaze.cc +++ b/gcc/config/microblaze/microblaze.cc @@ -2792,8 +2792,7 @@ microblaze_function_prologue (FILE * file) ASM_OUTPUT_TYPE_DIRECTIVE (file, fnname, "function"); } - assemble_name (file, fnname); - fputs (":\n", file); + ASM_OUTPUT_FUNCTION_LABEL (file, fnname, current_function_decl); if (interrupt_handler && strcmp (INTERRUPT_HANDLER_NAME, fnname)) fputs ("_interrupt_handler:\n", file); diff --git a/gcc/config/mips/mips.cc b/gcc/config/mips/mips.cc index 46b7d9b64fff2a9ae5a9f8bd28c7786366cd7db4..60b336e43d0fc09c272b5171a440b2c5968e560b 100644 --- a/gcc/config/mips/mips.cc +++ b/gcc/config/mips/mips.cc @@ -7300,7 +7300,7 @@ mips_gimplify_va_arg_expr (tree valist, tree type, gimple_seq *pre_p, /* Declare a unique, locally-binding function called NAME, then start its definition. */ -static void +static tree mips_start_unique_function (const char *name) { tree decl; @@ -7322,13 +7322,15 @@ mips_start_unique_function (const char *name) fputs ("\t.hidden\t", asm_out_file); assemble_name (asm_out_file, name); putc ('\n', asm_out_file); + + return decl; } /* Start a definition of function NAME. MIPS16_P indicates whether the function contains MIPS16 code. */ static void -mips_start_function_definition (const char *name, bool mips16_p) +mips_start_function_definition (const char *name, bool mips16_p, tree decl) { if (mips16_p) fprintf (asm_out_file, "\t.set\tmips16\n"); @@ -7352,8 +7354,7 @@ mips_start_function_definition (const char *name, bool mips16_p) ASM_OUTPUT_TYPE_DIRECTIVE (asm_out_file, name, "function"); /* Start the definition proper. */ - assemble_name (asm_out_file, name); - fputs (":\n", asm_out_file); + ASM_OUTPUT_FUNCTION_LABEL (asm_out_file, name, decl); } /* End a function definition started by mips_start_function_definition. */ @@ -7380,8 +7381,8 @@ mips_finish_stub (mips_one_only_stub **stub_ptr) return; const char *name = stub->get_name (); - mips_start_unique_function (name); - mips_start_function_definition (name, false); + tree decl = mips_start_unique_function (name); + mips_start_function_definition (name, false, decl); stub->output_body (); mips_end_function_definition (name); delete stub; @@ -7635,7 +7636,7 @@ mips16_build_function_stub (void) /* Start the function definition. */ assemble_start_function (stubdecl, stubname); - mips_start_function_definition (stubname, false); + mips_start_function_definition (stubname, false, stubdecl); /* If generating pic2 code, either set up the global pointer or switch to pic0. */ @@ -7895,7 +7896,7 @@ mips16_build_call_stub (rtx retval, rtx *fn_ptr, rtx args_size, int fp_code) /* Start the function definition. */ assemble_start_function (stubdecl, stubname); - mips_start_function_definition (stubname, false); + mips_start_function_definition (stubname, false, stubdecl); if (fp_ret_p) { @@ -12095,7 +12096,7 @@ mips_output_function_prologue (FILE *file) assemble_start_function. This is needed so that the name used here exactly matches the name used in ASM_DECLARE_FUNCTION_NAME. */ fnname = XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0); - mips_start_function_definition (fnname, TARGET_MIPS16); + mips_start_function_definition (fnname, TARGET_MIPS16, current_function_decl); /* Output MIPS-specific frame information. */ if (!flag_inhibit_size_directive) diff --git a/gcc/config/pa/pa.cc b/gcc/config/pa/pa.cc index 0b97a55e32cf1b58de94eeaae39ee14adcf8c7d1..48a370cdc200116306855b360b1ca5b357f9670f 100644 --- a/gcc/config/pa/pa.cc +++ b/gcc/config/pa/pa.cc @@ -3991,7 +3991,8 @@ pa_output_function_label (FILE *file) /* The function's label and associated .PROC must never be separated and must be output *after* any profiling declarations to avoid changing spaces/subspaces within a procedure. */ - ASM_OUTPUT_LABEL (file, XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0)); + const char *name = XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0); + ASM_OUTPUT_FUNCTION_LABEL (file, name, current_function_decl); fputs ("\t.PROC\n", file); /* pa_expand_prologue does the dirty work now. We just need diff --git a/gcc/config/riscv/riscv.cc b/gcc/config/riscv/riscv.cc index 6bd22369a5e067f3e1b6bb5f14b03e3ba636fc50..32183d63180f1af058eddccc96fc096858760dc6 100644 --- a/gcc/config/riscv/riscv.cc +++ b/gcc/config/riscv/riscv.cc @@ -8519,7 +8519,7 @@ riscv_declare_function_name (FILE *stream, const char *name, tree fndecl) { riscv_asm_output_variant_cc (stream, fndecl, name); ASM_OUTPUT_TYPE_DIRECTIVE (stream, name, "function"); - ASM_OUTPUT_LABEL (stream, name); + ASM_OUTPUT_FUNCTION_LABEL (stream, name, fndecl); if (DECL_FUNCTION_SPECIFIC_TARGET (fndecl)) { fprintf (stream, "\t.option push\n"); diff --git a/gcc/config/rs6000/rs6000.cc b/gcc/config/rs6000/rs6000.cc index 7aeed6fb1490502c25a1904ea8fa066a4b173bfb..94fbf46f2b6453aa48e296e349434caaee190c3b 100644 --- a/gcc/config/rs6000/rs6000.cc +++ b/gcc/config/rs6000/rs6000.cc @@ -21419,7 +21419,7 @@ rs6000_elf_declare_function_name (FILE *file, const char *name, tree decl) fputs ("\t.long 0\n", file); fprintf (file, "\t.previous\n"); } - ASM_OUTPUT_LABEL (file, name); + ASM_OUTPUT_FUNCTION_LABEL (file, name, decl); } static void rs6000_elf_file_end (void) ATTRIBUTE_UNUSED; @@ -21992,7 +21992,7 @@ rs6000_xcoff_declare_function_name (FILE *file, const char *name, tree decl) assemble_name (file, buffer); fputs (TARGET_32BIT ? "\n" : ",3\n", file); - ASM_OUTPUT_LABEL (file, buffer); + ASM_OUTPUT_FUNCTION_LABEL (file, buffer, decl); symtab_node::get (decl)->call_for_symbol_and_aliases (rs6000_declare_alias, &data, true);