OMP_ATOMIC_DEPENDENT_P (in OMP_ATOMIC)
OMP_FOR_GIMPLIFYING_P (in OMP_FOR)
BASELINK_QUALIFIED_P (in BASELINK)
+ TARGET_EXPR_IMPLICIT_P (in TARGET_EXPR)
1: IDENTIFIER_VIRTUAL_P (in IDENTIFIER_NODE)
TI_PENDING_TEMPLATE_FLAG.
TEMPLATE_PARMS_FOR_INLINE.
expression statement. */
#define EXPR_STMT_EXPR(NODE) TREE_OPERAND (EXPR_STMT_CHECK (NODE), 0)
+/* True if this TARGET_EXPR was created by build_cplus_new, and so we can
+ discard it if it isn't useful. */
+#define TARGET_EXPR_IMPLICIT_P(NODE) \
+ TREE_LANG_FLAG_0 (TARGET_EXPR_CHECK (NODE))
+
/* An enumeration of the kind of tags that C++ accepts. */
enum tag_types {
none_type = 0, /* Not a tag type. */
break;
}
+ case TARGET_EXPR:
+ /* Don't bother with the temporary object returned from a function if
+ we don't use it and don't need to destroy it. We'll still
+ allocate space for it in expand_call or declare_return_variable,
+ but we don't need to track it through all the tree phases. */
+ if (0 && TARGET_EXPR_IMPLICIT_P (expr)
+ && TYPE_HAS_TRIVIAL_DESTRUCTOR (TREE_TYPE (expr)))
+ {
+ tree init = TARGET_EXPR_INITIAL (expr);
+ if (TREE_CODE (init) == AGGR_INIT_EXPR
+ && !AGGR_INIT_VIA_CTOR_P (init))
+ {
+ tree fn = TREE_OPERAND (init, 0);
+ expr = build3 (CALL_EXPR, TREE_TYPE (TREE_TYPE (TREE_TYPE (fn))),
+ fn, TREE_OPERAND (init, 1), NULL_TREE);
+ }
+ }
+ break;
+
default:;
}
{
static void remap_save_expr (tree *, void *, int *);
static void add_lexical_block (tree current_block, tree new_block);
static tree copy_decl_to_var (tree, copy_body_data *);
+static tree copy_result_decl_to_var (tree, copy_body_data *);
static tree copy_decl_no_change (tree, copy_body_data *);
static tree copy_decl_maybe_to_var (tree, copy_body_data *);
gcc_assert (TREE_CODE (TYPE_SIZE_UNIT (callee_type)) == INTEGER_CST);
- var = copy_decl_to_var (result, id);
+ var = copy_result_decl_to_var (result, id);
DECL_SEEN_IN_BIND_EXPR_P (var) = 1;
DECL_STRUCT_FUNCTION (caller)->unexpanded_var_list
not be visible to the user. */
TREE_NO_WARNING (var) = 1;
+ declare_inline_vars (id->block, var);
+
/* Build the use expr. If the return type of the function was
promoted, convert it back to the expected type. */
use = var;
STRIP_USELESS_TYPE_CONVERSION (use);
+ if (DECL_BY_REFERENCE (result))
+ var = build_fold_addr_expr (var);
+
done:
/* Register the VAR_DECL as the equivalent for the RESULT_DECL; that
way, when the RESULT_DECL is encountered, it will be
bool successfully_inlined = FALSE;
tree t_step;
tree var;
- tree decl;
/* See what we've got. */
id = (copy_body_data *) data;
modify_dest = NULL;
/* Declare the return variable for the function. */
- decl = declare_return_variable (id, return_slot_addr,
- modify_dest, &use_retvar);
- /* Do this only if declare_return_variable created a new one. */
- if (decl && !return_slot_addr && decl != modify_dest)
- declare_inline_vars (id->block, decl);
+ declare_return_variable (id, return_slot_addr,
+ modify_dest, &use_retvar);
/* This is it. Duplicate the callee body. Assume callee is
pre-gimplified. Note that we must not alter the caller
return copy_decl_for_dup_finish (id, decl, copy);
}
+/* Like copy_decl_to_var, but create a return slot object instead of a
+ pointer variable for return by invisible reference. */
+
+static tree
+copy_result_decl_to_var (tree decl, copy_body_data *id)
+{
+ tree copy, type;
+
+ gcc_assert (TREE_CODE (decl) == PARM_DECL
+ || TREE_CODE (decl) == RESULT_DECL);
+
+ type = TREE_TYPE (decl);
+ if (DECL_BY_REFERENCE (decl))
+ type = TREE_TYPE (type);
+
+ copy = build_decl (VAR_DECL, DECL_NAME (decl), type);
+ TREE_READONLY (copy) = TREE_READONLY (decl);
+ TREE_THIS_VOLATILE (copy) = TREE_THIS_VOLATILE (decl);
+ if (!DECL_BY_REFERENCE (decl))
+ {
+ TREE_ADDRESSABLE (copy) = TREE_ADDRESSABLE (decl);
+ DECL_COMPLEX_GIMPLE_REG_P (copy) = DECL_COMPLEX_GIMPLE_REG_P (decl);
+ }
+
+ return copy_decl_for_dup_finish (id, decl, copy);
+}
+
+
static tree
copy_decl_no_change (tree decl, copy_body_data *id)
{