Commit 5e0de251 by Doug Evans

(expand_call): Use new FUNCTION_ARG_CALLEE_COPIES macro.

From-SVN: r4183
parent fd6b2a6d
...@@ -915,8 +915,24 @@ expand_call (exp, target, ignore) ...@@ -915,8 +915,24 @@ expand_call (exp, target, ignore)
if (FUNCTION_ARG_PASS_BY_REFERENCE (args_so_far, TYPE_MODE (type), type, if (FUNCTION_ARG_PASS_BY_REFERENCE (args_so_far, TYPE_MODE (type), type,
argpos < n_named_args)) argpos < n_named_args))
{ {
/* We make a copy of the object and pass the address to the function #ifdef FUNCTION_ARG_CALLEE_COPIES
being called. */ 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))))
{
args[i].tree_value = build1 (ADDR_EXPR,
build_pointer_type (type),
args[i].tree_value);
type = build_pointer_type (type);
}
else
#endif
{
/* We make a copy of the object and pass the address to the
function being called. */
rtx copy; rtx copy;
if (TYPE_SIZE (type) == 0 if (TYPE_SIZE (type) == 0
...@@ -934,7 +950,8 @@ expand_call (exp, target, ignore) ...@@ -934,7 +950,8 @@ expand_call (exp, target, ignore)
} }
copy = gen_rtx (MEM, BLKmode, copy = gen_rtx (MEM, BLKmode,
allocate_dynamic_stack_space (size_rtx, NULL_RTX, allocate_dynamic_stack_space (size_rtx,
NULL_RTX,
TYPE_ALIGN (type))); TYPE_ALIGN (type)));
} }
else else
...@@ -945,11 +962,13 @@ expand_call (exp, target, ignore) ...@@ -945,11 +962,13 @@ expand_call (exp, target, ignore)
store_expr (args[i].tree_value, copy, 0); store_expr (args[i].tree_value, copy, 0);
args[i].tree_value = build1 (ADDR_EXPR, build_pointer_type (type), args[i].tree_value = build1 (ADDR_EXPR,
build_pointer_type (type),
make_tree (type, copy)); make_tree (type, copy));
type = build_pointer_type (type); type = build_pointer_type (type);
} }
#endif }
#endif /* FUNCTION_ARG_PASS_BY_REFERENCE */
mode = TYPE_MODE (type); mode = TYPE_MODE (type);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment