+2019-05-16 Max Filippov <jcmvbkbc@gmail.com>
+
+ * cgraphunit.c (cgraph_node::expand_thunk): Remove
+ assemble_start_function and assemble_end_function calls.
+ * config/alpha/alpha.c (alpha_output_mi_thunk_osf): Call
+ assemble_start_function and assemble_end_function.
+ * config/arc/arc.c (arc_output_mi_thunk): Likewise.
+ * config/arm/arm.c (arm_output_mi_thunk): Likewise.
+ * config/bfin/bfin.c (bfin_output_mi_thunk): Likewise.
+ * config/c6x/c6x.c (c6x_output_mi_thunk): Likewise.
+ * config/cris/cris.c (cris_asm_output_mi_thunk): Likewise.
+ * config/csky/csky.c (csky_output_mi_thunk): Likewise.
+ * config/epiphany/epiphany.c (epiphany_output_mi_thunk): Likewise.
+ * config/frv/frv.c (frv_asm_output_mi_thunk): Likewise.
+ * config/i386/i386.c (x86_output_mi_thunk): Likewise.
+ * config/ia64/ia64.c (ia64_output_mi_thunk): Likewise.
+ * config/m68k/m68k.c (m68k_output_mi_thunk): Likewise.
+ * config/microblaze/microblaze.c (microblaze_asm_output_mi_thunk):
+ Likewise.
+ * config/mips/mips.c (mips_output_mi_thunk): Likewise.
+ * config/mmix/mmix.c (mmix_asm_output_mi_thunk): Likewise.
+ * config/mn10300/mn10300.c (mn10300_asm_output_mi_thunk): Likewise.
+ * config/nds32/nds32.c (nds32_asm_output_mi_thunk): Likewise.
+ * config/nios2/nios2.c (nios2_asm_output_mi_thunk): Likewise.
+ * config/or1k/or1k.c (or1k_output_mi_thunk): Likewise.
+ * config/pa/pa.c (pa_asm_output_mi_thunk): Likewise.
+ * config/riscv/riscv.c (riscv_output_mi_thunk): Likewise.
+ * config/rs6000/rs6000.c (rs6000_output_mi_thunk): Likewise.
+ * config/s390/s390.c (s390_output_mi_thunk): Likewise.
+ * config/sh/sh.c (sh_output_mi_thunk): Likewise.
+ * config/sparc/sparc.c (sparc_output_mi_thunk): Likewise.
+ * config/spu/spu.c (spu_output_mi_thunk): Likewise.
+ * config/stormy16/stormy16.c (xstormy16_asm_output_mi_thunk):
+ Likewise.
+ * config/tilegx/tilegx.c (tilegx_output_mi_thunk): Likewise.
+ * config/tilepro/tilepro.c (tilepro_asm_output_mi_thunk): Likewise.
+ * config/vax/vax.c (vax_output_mi_thunk): Likewise.
+
2019-05-16 Jan Hubicka <hubicka@ucw.cz>
* tree-ssa-alias.c (alias_stats): Add
&& targetm.asm_out.can_output_mi_thunk (thunk_fndecl, fixed_offset,
virtual_value, alias))
{
- const char *fnname;
tree fn_block;
tree restype = TREE_TYPE (TREE_TYPE (thunk_fndecl));
= build_decl (DECL_SOURCE_LOCATION (thunk_fndecl),
RESULT_DECL, 0, restype);
DECL_CONTEXT (DECL_RESULT (thunk_fndecl)) = thunk_fndecl;
- fnname = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (thunk_fndecl));
/* The back end expects DECL_INITIAL to contain a BLOCK, so we
create one. */
insn_locations_init ();
set_curr_insn_location (DECL_SOURCE_LOCATION (thunk_fndecl));
prologue_location = curr_insn_location ();
- assemble_start_function (thunk_fndecl, fnname);
targetm.asm_out.output_mi_thunk (asm_out_file, thunk_fndecl,
fixed_offset, virtual_value, alias);
- assemble_end_function (thunk_fndecl, fnname);
insn_locations_finalize ();
init_insn_lengths ();
free_after_compilation (cfun);
HOST_WIDE_INT delta, HOST_WIDE_INT vcall_offset,
tree function)
{
+ const char *fnname = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (thunk_fndecl));
HOST_WIDE_INT hi, lo;
rtx this_rtx, funexp;
rtx_insn *insn;
assemble_start_function and assemble_end_function. */
insn = get_insns ();
shorten_branches (insn);
+ assemble_start_function (thunk_fndecl, fnname);
final_start_function (insn, file, 1);
final (insn, file, 1);
final_end_function ();
+ assemble_end_function (thunk_fndecl, fnname);
}
#endif /* TARGET_ABI_OSF */
\f
HOST_WIDE_INT vcall_offset,
tree function)
{
+ const char *fnname = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (thunk));
int mi_delta = delta;
const char *const mi_op = mi_delta < 0 ? "sub" : "add";
int shift = 0;
= aggregate_value_p (TREE_TYPE (TREE_TYPE (function)), function) ? 1 : 0;
rtx fnaddr;
+ assemble_start_function (thunk, fnname);
+
if (mi_delta < 0)
mi_delta = - mi_delta;
fputs ("@plt\n", file);
}
fputc ('\n', file);
+ assemble_end_function (thunk, fnname);
}
/* Return true if a 32 bit "long_call" should be generated for
arm_output_mi_thunk (FILE *file, tree thunk, HOST_WIDE_INT delta,
HOST_WIDE_INT vcall_offset, tree function)
{
+ const char *fnname = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (thunk));
+
+ assemble_start_function (thunk, fnname);
if (TARGET_32BIT)
arm32_output_mi_thunk (file, thunk, delta, vcall_offset, function);
else
arm_thumb1_mi_thunk (file, thunk, delta, vcall_offset, function);
+ assemble_end_function (thunk, fnname);
}
int
tree thunk ATTRIBUTE_UNUSED, HOST_WIDE_INT delta,
HOST_WIDE_INT vcall_offset, tree function)
{
+ const char *fnname = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (thunk));
rtx xops[3];
/* The this parameter is passed as the first argument. */
rtx this_rtx = gen_rtx_REG (Pmode, REG_R0);
+ assemble_start_function (thunk, fnname);
/* Adjust the this parameter by a fixed constant. */
if (delta)
{
xops[0] = XEXP (DECL_RTL (function), 0);
if (1 || !flag_pic || (*targetm.binds_local_p) (function))
output_asm_insn ("jump.l\t%P0", xops);
+ assemble_end_function (thunk, fnname);
}
\f
/* Codes for all the Blackfin builtins. */
tree thunk ATTRIBUTE_UNUSED, HOST_WIDE_INT delta,
HOST_WIDE_INT vcall_offset, tree function)
{
+ const char *fnname = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (thunk));
rtx xops[5];
/* The this parameter is passed as the first argument. */
rtx this_rtx = gen_rtx_REG (Pmode, REG_A4);
+ assemble_start_function (thunk, fnname);
c6x_current_insn = NULL;
xops[4] = XEXP (DECL_RTL (function), 0);
output_asm_insn ("nop 4", xops);
output_asm_insn ("add .d1 %2, %1, %2", xops);
}
+ assemble_end_function (thunk, fnname);
}
\f
/* Return true if EXP goes in small data/bss. */
HOST_WIDE_INT vcall_offset ATTRIBUTE_UNUSED,
tree funcdecl)
{
+ const char *fnname = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (thunkdecl));
+
+ assemble_start_function (thunkdecl, fnname);
/* Make sure unwind info is emitted for the thunk if needed. */
final_start_function (emit_barrier (), stream, 1);
}
final_end_function ();
+ assemble_end_function (thunkdecl, fnname);
}
/* Boilerplate emitted at start of file.
HOST_WIDE_INT vcall_offset,
tree function)
{
+ const char *fnname = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (thunk));
const char *thiz = "a0";
const char *reg0 = "t0";
const char *reg1 = "t1";
int maxoff = 4096; /* Constant range for addi/subi. */
+ assemble_start_function (thunk, fnname);
final_start_function (emit_barrier (), file, 1);
rtx fnaddr = XEXP (DECL_RTL (function), 0);
fprintf (file, "\n");
final_end_function ();
+ assemble_end_function (thunk, fnname);
}
HOST_WIDE_INT vcall_offset,
tree function)
{
+ const char *fnname = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (thunk));
int this_regno
= aggregate_value_p (TREE_TYPE (TREE_TYPE (function)), function) ? 1 : 0;
const char *this_name = reg_names[this_regno];
const char *fname;
+ assemble_start_function (thunk, fnname);
/* We use IP and R16 as a scratch registers. */
gcc_assert (call_used_regs [GPR_IP]);
gcc_assert (call_used_regs [GPR_16]);
assemble_name (file, fname);
fputc ('\n', file);
}
+ assemble_end_function (thunk, fnname);
}
void
HOST_WIDE_INT vcall_offset ATTRIBUTE_UNUSED,
tree function)
{
+ const char *fnname = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (thunk_fndecl));
const char *name_func = XSTR (XEXP (DECL_RTL (function), 0), 0);
const char *name_arg0 = reg_names[FIRST_ARG_REGNUM];
const char *name_jmp = reg_names[JUMP_REGNO];
const char *parallel = (frv_issue_rate () > 1 ? ".p" : "");
+ assemble_start_function (thunk_fndecl, fnname);
+
/* Do the add using an addi if possible. */
if (IN_RANGE (delta, -2048, 2047))
fprintf (file, "\taddi %s,#%d,%s\n", name_arg0, (int) delta, name_arg0);
/* Jump to the function address. */
fprintf (file, "\tjmpl @(%s,%s)\n", name_jmp, reg_names[GPR_FIRST+0]);
+ assemble_end_function (thunk_fndecl, fnname);
}
\f
*(*this + vcall_offset) should be added to THIS. */
static void
-x86_output_mi_thunk (FILE *file, tree, HOST_WIDE_INT delta,
+x86_output_mi_thunk (FILE *file, tree thunk_fndecl, HOST_WIDE_INT delta,
HOST_WIDE_INT vcall_offset, tree function)
{
+ const char *fnname = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (thunk_fndecl));
rtx this_param = x86_this_parameter (function);
rtx this_reg, tmp, fnaddr;
unsigned int tmp_regno;
Note that use_thunk calls assemble_start_function et al. */
insn = get_insns ();
shorten_branches (insn);
+ assemble_start_function (thunk_fndecl, fnname);
final_start_function (insn, file, 1);
final (insn, file, 1);
final_end_function ();
+ assemble_end_function (thunk_fndecl, fnname);
}
static void
HOST_WIDE_INT delta, HOST_WIDE_INT vcall_offset,
tree function)
{
+ const char *fnname = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (thunk));
rtx this_rtx, funexp;
rtx_insn *insn;
unsigned int this_parmno;
emit_all_insn_group_barriers (NULL);
insn = get_insns ();
shorten_branches (insn);
+ assemble_start_function (thunk, fnname);
final_start_function (insn, file, 1);
final (insn, file, 1);
final_end_function ();
+ assemble_end_function (thunk, fnname);
reload_completed = 0;
epilogue_completed = 0;
HOST_WIDE_INT delta, HOST_WIDE_INT vcall_offset,
tree function)
{
+ const char *fnname = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (thunk));
rtx this_slot, offset, addr, mem, tmp;
rtx_insn *insn;
/* Run just enough of rest_of_compilation. */
insn = get_insns ();
split_all_insns_noflow ();
+ assemble_start_function (thunk, fnname);
final_start_function (insn, file, 1);
final (insn, file, 1);
final_end_function ();
+ assemble_end_function (thunk, fnname);
/* Clean up the vars set above. */
reload_completed = 0;
HOST_WIDE_INT delta, HOST_WIDE_INT vcall_offset,
tree function)
{
+ const char *fnname = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (thunk_fndecl));
rtx this_rtx, funexp;
rtx_insn *insn;
"borrowed" from rs6000.c. */
insn = get_insns ();
shorten_branches (insn);
+ assemble_start_function (thunk_fndecl, fnname);
final_start_function (insn, file, 1);
final (insn, file, 1);
final_end_function ();
+ assemble_end_function (thunk_fndecl, fnname);
reload_completed = 0;
epilogue_completed = 0;
HOST_WIDE_INT delta, HOST_WIDE_INT vcall_offset,
tree function)
{
+ const char *fnname = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (thunk_fndecl));
rtx this_rtx, temp1, temp2, fnaddr;
rtx_insn *insn;
bool use_sibcall_p;
split_all_insns_noflow ();
mips16_lay_out_constants (true);
shorten_branches (insn);
+ assemble_start_function (thunk_fndecl, fnname);
final_start_function (insn, file, 1);
final (insn, file, 1);
final_end_function ();
+ assemble_end_function (thunk_fndecl, fnname);
/* Clean up the vars set above. Note that final_end_function resets
the global pointer for us. */
static void
mmix_asm_output_mi_thunk (FILE *stream,
- tree fndecl ATTRIBUTE_UNUSED,
+ tree thunk_fndecl ATTRIBUTE_UNUSED,
HOST_WIDE_INT delta,
HOST_WIDE_INT vcall_offset ATTRIBUTE_UNUSED,
tree func)
location of structure to return as invisible first argument), you
need to tweak this code too. */
const char *regname = reg_names[MMIX_FIRST_INCOMING_ARG_REGNUM];
+ const char *fnname = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (thunk_fndecl));
+
+ assemble_start_function (thunk_fndecl, fnname);
if (delta >= 0 && delta < 65536)
fprintf (stream, "\tINCL %s,%d\n", regname, (int)delta);
fprintf (stream, "\tJMP ");
assemble_name (stream, XSTR (XEXP (DECL_RTL (func), 0), 0));
fprintf (stream, "\n");
+ assemble_end_function (thunk_fndecl, fnname);
}
/* FUNCTION_PROFILER. */
HOST_WIDE_INT vcall_offset,
tree function)
{
+ const char *fnname = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (thunk_fndecl));
const char * _this;
+ assemble_start_function (thunk_fndecl, fnname);
/* Get the register holding the THIS parameter. Handle the case
where there is a hidden first argument for a returned structure. */
if (aggregate_value_p (TREE_TYPE (TREE_TYPE (function)), function))
fputs ("\tjmp ", file);
assemble_name (file, XSTR (XEXP (DECL_RTL (function), 0), 0));
putc ('\n', file);
+ assemble_end_function (thunk_fndecl, fnname);
}
/* Return true if mn10300_output_mi_thunk would be able to output the
HOST_WIDE_INT vcall_offset ATTRIBUTE_UNUSED,
tree function)
{
+ const char *fnname = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (thunk));
int this_regno;
+ assemble_start_function (thunk, fnname);
/* Make sure unwind info is emitted for the thunk if needed. */
final_start_function (emit_barrier (), file, 1);
}
final_end_function ();
+ assemble_end_function (thunk, fnname);
}
/* -- Permitting tail calls. */
HOST_WIDE_INT delta, HOST_WIDE_INT vcall_offset,
tree function)
{
+ const char *fnname = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (thunk_fndecl));
rtx this_rtx, funexp;
rtx_insn *insn;
assemble_start_function and assemble_end_function. */
insn = get_insns ();
shorten_branches (insn);
+ assemble_start_function (thunk_fndecl, fnname);
final_start_function (insn, file, 1);
final (insn, file, 1);
final_end_function ();
+ assemble_end_function (thunk_fndecl, fnname);
/* Stop pretending to be a post-reload pass. */
reload_completed = 0;
(*THIS + VCALL_OFFSET) should be additionally added to THIS. */
static void
-or1k_output_mi_thunk (FILE *file, tree /* thunk_fndecl */,
+or1k_output_mi_thunk (FILE *file, tree thunk_fndecl,
HOST_WIDE_INT delta, HOST_WIDE_INT vcall_offset,
tree function)
{
+ const char *fnname = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (thunk_fndecl));
rtx this_rtx, funexp;
rtx_insn *insn;
assemble_start_function and assemble_end_function. */
insn = get_insns ();
shorten_branches (insn);
+ assemble_start_function (thunk_fndecl, fnname);
final_start_function (insn, file, 1);
final (insn, file, 1);
final_end_function ();
+ assemble_end_function (thunk_fndecl, fnname);
reload_completed = 0;
epilogue_completed = 0;
HOST_WIDE_INT vcall_offset ATTRIBUTE_UNUSED,
tree function)
{
+ const char *fnname = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (thunk_fndecl));
static unsigned int current_thunk_number;
int val_14 = VAL_14_BITS_P (delta);
unsigned int old_last_address = last_address, nbytes = 0;
xoperands[1] = XEXP (DECL_RTL (thunk_fndecl), 0);
xoperands[2] = GEN_INT (delta);
+ assemble_start_function (thunk_fndecl, fnname);
final_start_function (emit_barrier (), file, 1);
/* Output the thunk. We know that the function is in the same
if (old_last_address > last_address)
last_address = UINT_MAX;
update_total_code_bytes (nbytes);
+ assemble_end_function (thunk_fndecl, fnname);
}
/* Only direct calls to static functions are allowed to be sibling (tail)
HOST_WIDE_INT delta, HOST_WIDE_INT vcall_offset,
tree function)
{
+ const char *fnname = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (thunk_fndecl));
rtx this_rtx, temp1, temp2, fnaddr;
rtx_insn *insn;
insn = get_insns ();
split_all_insns_noflow ();
shorten_branches (insn);
+ assemble_start_function (thunk_fndecl, fnname);
final_start_function (insn, file, 1);
final (insn, file, 1);
final_end_function ();
+ assemble_end_function (thunk_fndecl, fnname);
/* Clean up the vars set above. Note that final_end_function resets
the global pointer for us. */
HOST_WIDE_INT delta, HOST_WIDE_INT vcall_offset,
tree function)
{
+ const char *fnname = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (thunk_fndecl));
rtx this_rtx, funexp;
rtx_insn *insn;
assemble_start_function and assemble_end_function. */
insn = get_insns ();
shorten_branches (insn);
+ assemble_start_function (thunk_fndecl, fnname);
final_start_function (insn, file, 1);
final (insn, file, 1);
final_end_function ();
+ assemble_end_function (thunk_fndecl, fnname);
reload_completed = 0;
epilogue_completed = 0;
HOST_WIDE_INT delta, HOST_WIDE_INT vcall_offset,
tree function)
{
+ const char *fnname = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (thunk));
rtx op[10];
int nonlocal = 0;
+ assemble_start_function (thunk, fnname);
/* Make sure unwind info is emitted for the thunk if needed. */
final_start_function (emit_barrier (), file, 1);
}
}
final_end_function ();
+ assemble_end_function (thunk, fnname);
}
/* Output either an indirect jump or a an indirect call
HOST_WIDE_INT delta, HOST_WIDE_INT vcall_offset,
tree function)
{
+ const char *fnname = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (thunk_fndecl));
CUMULATIVE_ARGS cum;
int structure_value_byref = 0;
rtx this_rtx, this_value, sibcall, funexp;
sh_reorg ();
shorten_branches (insns);
+ assemble_start_function (thunk_fndecl, fnname);
final_start_function (insns, file, 1);
final (insns, file, 1);
final_end_function ();
+ assemble_end_function (thunk_fndecl, fnname);
reload_completed = 0;
epilogue_completed = 0;
HOST_WIDE_INT delta, HOST_WIDE_INT vcall_offset,
tree function)
{
+ const char *fnname = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (thunk_fndecl));
rtx this_rtx, funexp;
rtx_insn *insn;
unsigned int int_arg_first;
assemble_start_function and assemble_end_function. */
insn = get_insns ();
shorten_branches (insn);
+ assemble_start_function (thunk_fndecl, fnname);
final_start_function (insn, file, 1);
final (insn, file, 1);
final_end_function ();
+ assemble_end_function (thunk_fndecl, fnname);
reload_completed = 0;
epilogue_completed = 0;
HOST_WIDE_INT delta, HOST_WIDE_INT vcall_offset,
tree function)
{
+ const char *fnname = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (thunk));
rtx op[8];
+ assemble_start_function (thunk, fnname);
/* Make sure unwind info is emitted for the thunk if needed. */
final_start_function (emit_barrier (), file, 1);
output_asm_insn ("br\t%0", op);
final_end_function ();
+ assemble_end_function (thunk, fnname);
}
/* Canonicalize a comparison from one we don't have to one we do have. */
HOST_WIDE_INT vcall_offset ATTRIBUTE_UNUSED,
tree function)
{
+ const char *fnname = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (thunk_fndecl));
int regnum = FIRST_ARGUMENT_REGISTER;
+ assemble_start_function (thunk_fndecl, fnname);
/* There might be a hidden first argument for a returned structure. */
if (aggregate_value_p (TREE_TYPE (TREE_TYPE (function)), function))
regnum += 1;
fputs ("\tjmpf ", file);
assemble_name (file, XSTR (XEXP (DECL_RTL (function), 0), 0));
putc ('\n', file);
+ assemble_end_function (thunk_fndecl, fnname);
}
/* The purpose of this function is to override the default behavior of
HOST_WIDE_INT delta, HOST_WIDE_INT vcall_offset,
tree function)
{
+ const char *fnname = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (thunk_fndecl));
rtx this_rtx, funexp, addend;
rtx_insn *insn;
*/
insn = get_insns ();
shorten_branches (insn);
+ assemble_start_function (thunk_fndecl, fnname);
final_start_function (insn, file, 1);
final (insn, file, 1);
final_end_function ();
+ assemble_end_function (thunk_fndecl, fnname);
/* Stop pretending to be a post-reload pass. */
reload_completed = 0;
HOST_WIDE_INT delta, HOST_WIDE_INT vcall_offset,
tree function)
{
+ const char *fnname = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (thunk_fndecl));
rtx this_rtx, funexp;
rtx_insn *insn;
*/
insn = get_insns ();
shorten_branches (insn);
+ assemble_start_function (thunk_fndecl, fnname);
final_start_function (insn, file, 1);
final (insn, file, 1);
final_end_function ();
+ assemble_end_function (thunk_fndecl, fnname);
/* Stop pretending to be a post-reload pass. */
reload_completed = 0;
HOST_WIDE_INT vcall_offset ATTRIBUTE_UNUSED,
tree function)
{
+ const char *fnname = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (thunk));
+
+ assemble_start_function (thunk, fnname);
fprintf (file, "\t.word 0x0ffc\n\taddl2 $" HOST_WIDE_INT_PRINT_DEC, delta);
asm_fprintf (file, ",4(%Rap)\n");
fprintf (file, "\tjmp ");
assemble_name (file, XSTR (XEXP (DECL_RTL (function), 0), 0));
fprintf (file, "+2\n");
+ assemble_end_function (thunk, fnname);
}
\f
static rtx