#endif
)
{
+ /* If we're compiling a thunk, pass through invisible
+ references instead of making a copy. */
+ if (current_function_is_thunk
#ifdef FUNCTION_ARG_CALLEE_COPIES
- if (FUNCTION_ARG_CALLEE_COPIES (args_so_far, TYPE_MODE (type), type,
- argpos < n_named_args)
- /* If it's in a register, we must make a copy of it too. */
- /* ??? Is this a sufficient test? Is there a better one? */
- && !(TREE_CODE (args[i].tree_value) == VAR_DECL
- && REG_P (DECL_RTL (args[i].tree_value)))
- && ! TREE_ADDRESSABLE (type))
+ || (FUNCTION_ARG_CALLEE_COPIES (args_so_far, TYPE_MODE (type),
+ type, argpos < n_named_args)
+ /* If it's in a register, we must make a copy of it too. */
+ /* ??? Is this a sufficient test? Is there a better one? */
+ && !(TREE_CODE (args[i].tree_value) == VAR_DECL
+ && REG_P (DECL_RTL (args[i].tree_value)))
+ && ! TREE_ADDRESSABLE (type))
+#endif
+ )
{
args[i].tree_value = build1 (ADDR_EXPR,
build_pointer_type (type),
type = build_pointer_type (type);
}
else
-#endif
{
/* We make a copy of the object and pass the address to the
function being called. */
function. */
extern int current_function_has_nonlocal_goto;
+
+/* Nonzero if the current function is a thunk, so we should try to cut
+ corners where we can. */
+int current_function_is_thunk;
int current_function_contains_functions;
+/* Nonzero if the current function is a thunk (a lightweight function that
+ just adjusts one of its arguments and forwards to another function), so
+ we should try to cut corners where we can. */
+int current_function_is_thunk;
+
/* Nonzero if function being compiled can call alloca,
either as a subroutine or builtin. */
p->has_nonlocal_label = current_function_has_nonlocal_label;
p->has_nonlocal_goto = current_function_has_nonlocal_goto;
p->contains_functions = current_function_contains_functions;
+ p->is_thunk = current_function_is_thunk;
p->args_size = current_function_args_size;
p->pretend_args_size = current_function_pretend_args_size;
p->arg_offset_rtx = current_function_arg_offset_rtx;
current_function_calls_alloca = p->calls_alloca;
current_function_has_nonlocal_label = p->has_nonlocal_label;
current_function_has_nonlocal_goto = p->has_nonlocal_goto;
+ current_function_is_thunk = p->is_thunk;
current_function_args_size = p->args_size;
current_function_pretend_args_size = p->pretend_args_size;
current_function_arg_offset_rtx = p->arg_offset_rtx;
current_function_has_nonlocal_label = 0;
current_function_has_nonlocal_goto = 0;
current_function_contains_functions = 0;
+ current_function_is_thunk = 0;
current_function_returns_pcc_struct = 0;
current_function_returns_struct = 0;
int has_nonlocal_label;
int has_nonlocal_goto;
int contains_functions;
+ int is_thunk;
rtx nonlocal_goto_handler_slot;
rtx nonlocal_goto_stack_level;
tree nonlocal_labels;