Commit 657bb6dc by Jason Merrill

Use TREE_ADDRESSABLE rather than | TYPE_NEEDS_CONSTRUCTING to decide whether a...

Use TREE_ADDRESSABLE rather than
|        TYPE_NEEDS_CONSTRUCTING to decide whether a parameter needs to be
|        passed by invisible reference.

From-SVN: r9420
parent a01408ab
...@@ -1022,7 +1022,7 @@ expand_call (exp, target, ignore) ...@@ -1022,7 +1022,7 @@ expand_call (exp, target, ignore)
/* See if this argument should be passed by invisible reference. */ /* See if this argument should be passed by invisible reference. */
if ((TREE_CODE (TYPE_SIZE (type)) != INTEGER_CST if ((TREE_CODE (TYPE_SIZE (type)) != INTEGER_CST
&& contains_placeholder_p (TYPE_SIZE (type))) && contains_placeholder_p (TYPE_SIZE (type)))
|| TYPE_NEEDS_CONSTRUCTING (type) || TREE_ADDRESSABLE (type)
#ifdef FUNCTION_ARG_PASS_BY_REFERENCE #ifdef FUNCTION_ARG_PASS_BY_REFERENCE
|| FUNCTION_ARG_PASS_BY_REFERENCE (args_so_far, TYPE_MODE (type), || FUNCTION_ARG_PASS_BY_REFERENCE (args_so_far, TYPE_MODE (type),
type, argpos < n_named_args) type, argpos < n_named_args)
...@@ -1325,6 +1325,10 @@ expand_call (exp, target, ignore) ...@@ -1325,6 +1325,10 @@ expand_call (exp, target, ignore)
|| (must_preallocate && (args_size.var != 0 || args_size.constant != 0) || (must_preallocate && (args_size.var != 0 || args_size.constant != 0)
&& calls_function (args[i].tree_value, 0))) && calls_function (args[i].tree_value, 0)))
{ {
/* If this is an addressable type, we cannot pre-evaluate it. */
if (TREE_ADDRESSABLE (TREE_TYPE (args[i].tree_value)))
abort ();
push_temp_slots (); push_temp_slots ();
args[i].initial_value = args[i].value args[i].initial_value = args[i].value
......
...@@ -3271,7 +3271,7 @@ assign_parms (fndecl, second_time) ...@@ -3271,7 +3271,7 @@ assign_parms (fndecl, second_time)
if ((TREE_CODE (TYPE_SIZE (passed_type)) != INTEGER_CST if ((TREE_CODE (TYPE_SIZE (passed_type)) != INTEGER_CST
&& contains_placeholder_p (TYPE_SIZE (passed_type))) && contains_placeholder_p (TYPE_SIZE (passed_type)))
|| TYPE_NEEDS_CONSTRUCTING (passed_type) || TREE_ADDRESSABLE (passed_type)
#ifdef FUNCTION_ARG_PASS_BY_REFERENCE #ifdef FUNCTION_ARG_PASS_BY_REFERENCE
|| FUNCTION_ARG_PASS_BY_REFERENCE (args_so_far, passed_mode, || FUNCTION_ARG_PASS_BY_REFERENCE (args_so_far, passed_mode,
passed_type, ! last_named) passed_type, ! last_named)
......
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