+2009-03-17 Jing Yu <jingyu@google.com>
+
+ PR middle-end/39378
+ * function.h: Move is_thunk from rtl_data structure to function
+ structure.
+ * cp/method.c (use_thunk): Change is_thunk from crtl to cfun.
+ * varasm.c (assemble_start_function): Change is_thunk from crtl to
+ cfun.
+ * config/alpha/alpha.c: Change is_thunk from crtl to cfun.
+ * config/rs6000/rs6000.c: Change is_thunk from crtl to cfun.
+ * config/arm/arm.h: Change is_thunk from crtl to cfun.
+
2009-03-17 Uros Bizjak <ubizjak@gmail.com>
PR target/39482
/* When outputting a thunk, we don't have valid register life info,
but assemble_start_function wants to output .frame and .mask
directives. */
- if (crtl->is_thunk)
+ if (cfun->is_thunk)
{
*imaskP = 0;
*fmaskP = 0;
return 1;
/* The code emitted by alpha_output_mi_thunk_osf uses the gp. */
- if (crtl->is_thunk)
+ if (cfun->is_thunk)
return 1;
/* The nonlocal receiver pattern assumes that the gp is valid for
Otherwise, do it here. */
if (TARGET_ABI_OSF
&& ! alpha_function_needs_gp
- && ! crtl->is_thunk)
+ && ! cfun->is_thunk)
{
putc ('$', file);
assemble_name (file, fnname);
fputs ("\t.prologue 0\n", file);
else if (!flag_inhibit_size_directive)
fprintf (file, "\t.prologue %d\n",
- alpha_function_needs_gp || crtl->is_thunk);
+ alpha_function_needs_gp || cfun->is_thunk);
}
/* Write function epilogue. */
output_asm_insn (get_insn_template (CODE_FOR_nop, NULL), NULL);
#if TARGET_ABI_OSF
- if (crtl->is_thunk)
+ if (cfun->is_thunk)
free_after_compilation (cfun);
#endif
HOST_WIDE_INT hi, lo;
rtx this_rtx, insn, funexp;
- gcc_assert (crtl->is_thunk);
+ gcc_assert (cfun->is_thunk);
/* We always require a valid GP. */
emit_insn (gen_prologue_ldgp ());
{ \
if (is_called_in_ARM_mode (DECL) \
|| (TARGET_THUMB1 && !TARGET_THUMB1_ONLY \
- && crtl->is_thunk)) \
+ && cfun->is_thunk)) \
fprintf (STREAM, "\t.code 32\n") ; \
else if (TARGET_THUMB1) \
fprintf (STREAM, "\t.code\t16\n\t.thumb_func\n") ; \
rtx reg;
rtx insn;
- if (crtl->is_thunk)
+ if (cfun->is_thunk)
return 0;
/* regs_ever_live has LR marked as used if any sibcalls are present,
System V.4 Powerpc's (and the embedded ABI derived from it) use a
different traceback table. */
if (DEFAULT_ABI == ABI_AIX && ! flag_inhibit_size_directive
- && rs6000_traceback != traceback_none && !crtl->is_thunk)
+ && rs6000_traceback != traceback_none && !cfun->is_thunk)
{
const char *fname = NULL;
const char *language_string = lang_hooks.name;
BLOCK_VARS (fn_block) = a;
DECL_INITIAL (thunk_fndecl) = fn_block;
init_function_start (thunk_fndecl);
- crtl->is_thunk = 1;
+ cfun->is_thunk = 1;
assemble_start_function (thunk_fndecl, fnname);
targetm.asm_out.output_mi_thunk (asm_out_file, thunk_fndecl,
/* Nonzero if function being compiled has an asm statement. */
bool has_asm_statement;
- /* Nonzero if the current function is a thunk, i.e., a lightweight
- function implemented by the output_mi_thunk hook) that just
- adjusts one of its arguments and forwards to another
- function. */
- bool is_thunk;
-
/* This bit is used by the exception handling logic. It is set if all
calls (if any) are sibling calls. Such functions do not have to
have EH tables generated, as they cannot throw. A call to such a
/* Nonzero if this function has local DECL_HARD_REGISTER variables.
In this case code motion has to be done more carefully. */
unsigned int has_local_explicit_reg_vars : 1;
+
+ /* Nonzero if the current function is a thunk, i.e., a lightweight
+ function implemented by the output_mi_thunk hook) that just
+ adjusts one of its arguments and forwards to another
+ function. */
+ unsigned int is_thunk : 1;
};
/* If va_list_[gf]pr_size is set to this, it means we don't know how
+2009-03-17 Jing Yu <jingyu@google.com>
+
+ PR middle-end/39378
+ * g++.dg/inherit/thunk10.C: New test.
+
2009-03-17 Uros Bizjak <ubizjak@gmail.com>
PR target/39482
/* When the function starts with a cold section, we need to explicitly
align the hot section and write out the hot section label.
But if the current function is a thunk, we do not have a CFG. */
- if (!crtl->is_thunk
+ if (!cfun->is_thunk
&& BB_PARTITION (ENTRY_BLOCK_PTR->next_bb) == BB_COLD_PARTITION)
{
switch_to_section (text_section);