call.c (build_over_call): Don't set TREE_SIDE_EFFECTS for situations where make_node will do it automatically.

1999-10-04  Mark Mitchell  <mark@codesourcery.com>

	* call.c (build_over_call): Don't set TREE_SIDE_EFFECTS for
	situations where make_node will do it automatically.
	* decl.c (grok_reference_init): Likewise.
	(expand_static_init): Likewise.
	(do_static_initialization): Likewise.
	* init.c (perform_member_init): Likewise.
	(expand_aggr_init_1): Likewise.
	(build_new_1): Likewise.
	* method.c (do_build_copy_constructor): Likewise.
	(do_build_assign_ref): Likewise.
	* search.c (expand_upcast_fixups): Likewise.
	* semantics.c (finish_stmt_expr): Likewise.
	* typeck.c (build_unary_op): Likewise.
	(check_return_expr): Likewise.

From-SVN: r29799
This commit is contained in:
Mark Mitchell 1999-10-04 09:15:17 +00:00 committed by Mark Mitchell
parent 783feeb034
commit c557501d33
8 changed files with 23 additions and 33 deletions

View File

@ -1,3 +1,20 @@
1999-10-04 Mark Mitchell <mark@codesourcery.com>
* call.c (build_over_call): Don't set TREE_SIDE_EFFECTS for
situations where make_node will do it automatically.
* decl.c (grok_reference_init): Likewise.
(expand_static_init): Likewise.
(do_static_initialization): Likewise.
* init.c (perform_member_init): Likewise.
(expand_aggr_init_1): Likewise.
(build_new_1): Likewise.
* method.c (do_build_copy_constructor): Likewise.
(do_build_assign_ref): Likewise.
* search.c (expand_upcast_fixups): Likewise.
* semantics.c (finish_stmt_expr): Likewise.
* typeck.c (build_unary_op): Likewise.
(check_return_expr): Likewise.
1999-10-04 Jason Merrill <jason@yorick.cygnus.com>
* init.c (build_vec_delete_1): Fold COND_EXPRs.

View File

@ -4066,7 +4066,6 @@ build_over_call (cand, args, flags)
val = build (is_empty_class (DECL_CLASS_CONTEXT (fn))
? MODIFY_EXPR : INIT_EXPR,
DECL_CONTEXT (fn), to, arg);
TREE_SIDE_EFFECTS (val) = 1;
address = build_unary_op (ADDR_EXPR, val, 0);
/* Avoid a warning about this expression, if the address is
never used. */
@ -4084,7 +4083,6 @@ build_over_call (cand, args, flags)
arg = build_indirect_ref (TREE_VALUE (TREE_CHAIN (converted_args)), 0);
val = build (MODIFY_EXPR, TREE_TYPE (to), to, arg);
TREE_SIDE_EFFECTS (val) = 1;
return val;
}

View File

@ -6999,9 +6999,6 @@ grok_reference_init (decl, type, init)
{
/* Initialize the declaration. */
tmp = build (INIT_EXPR, TREE_TYPE (decl), decl, tmp);
/* Setting TREE_SIDE_EFFECTS prevents expand_expr from
omitting this expression entirely. */
TREE_SIDE_EFFECTS (tmp) = 1;
finish_expr_stmt (tmp);
}
else
@ -8028,12 +8025,9 @@ expand_static_init (decl, init)
|| (init && TREE_CODE (init) == TREE_LIST))
assignment = build_aggr_init (decl, init, 0);
else if (init)
{
/* The initialization we're doing here is just a bitwise
copy. */
assignment = build (INIT_EXPR, TREE_TYPE (decl), decl, init);
TREE_SIDE_EFFECTS (assignment) = 1;
}
/* The initialization we're doing here is just a bitwise
copy. */
assignment = build (INIT_EXPR, TREE_TYPE (decl), decl, init);
else
assignment = NULL_TREE;

View File

@ -149,7 +149,6 @@ perform_member_init (member, name, init, explicit)
if (ANON_AGGR_TYPE_P (type))
{
init = build (INIT_EXPR, type, decl, TREE_VALUE (init));
TREE_SIDE_EFFECTS (init) = 1;
finish_expr_stmt (init);
}
else if (TYPE_NEEDS_CONSTRUCTING (type)
@ -1247,11 +1246,7 @@ expand_aggr_init_1 (binfo, true_exp, exp, init, flags)
expand_decl_init (exp);
}
else
{
tree t = build (INIT_EXPR, type, exp, init);
TREE_SIDE_EFFECTS (t) = 1;
finish_expr_stmt (t);
}
finish_expr_stmt (build (INIT_EXPR, type, exp, init));
return;
}
@ -2271,7 +2266,6 @@ build_new_1 (exp)
build_component_ref (cookie, nelts_identifier,
NULL_TREE, 0),
nelts);
TREE_SIDE_EFFECTS (exp1) = 1;
rval = cp_convert (build_pointer_type (true_type), rval);
rval = build_compound_expr
(tree_cons (NULL_TREE, exp1,
@ -2424,7 +2418,6 @@ build_new_1 (exp)
end = build (MODIFY_EXPR, TREE_TYPE (sentry),
sentry, boolean_false_node);
TREE_SIDE_EFFECTS (end) = 1;
buf = TREE_OPERAND (rval, 0);

View File

@ -2188,7 +2188,6 @@ do_build_copy_constructor (fndecl)
else if (TYPE_HAS_TRIVIAL_INIT_REF (current_class_type))
{
t = build (INIT_EXPR, void_type_node, current_class_ref, parm);
TREE_SIDE_EFFECTS (t) = 1;
finish_expr_stmt (t);
}
else
@ -2270,7 +2269,6 @@ do_build_assign_ref (fndecl)
else if (TYPE_HAS_TRIVIAL_ASSIGN_REF (current_class_type))
{
tree t = build (MODIFY_EXPR, void_type_node, current_class_ref, parm);
TREE_SIDE_EFFECTS (t) = 1;
finish_expr_stmt (t);
}
else

View File

@ -2680,7 +2680,6 @@ expand_upcast_fixups (binfo, addr, orig_addr, vbase, vbase_addr, t,
init = build (MODIFY_EXPR, TREE_TYPE (nvtbl),
nvtbl, vtbl);
TREE_SIDE_EFFECTS (init) = 1;
finish_expr_stmt (init);
/* Update the vtable pointers as necessary. */
ref = build_vfield_ref

View File

@ -1356,11 +1356,7 @@ finish_stmt_expr (rtl_expr)
tree result;
if (!building_stmt_tree ())
{
rtl_expr = expand_end_stmt_expr (rtl_expr);
/* The statements have side effects, so the group does too. */
TREE_SIDE_EFFECTS (rtl_expr) = 1;
}
rtl_expr = expand_end_stmt_expr (rtl_expr);
if (building_stmt_tree ())
{

View File

@ -4567,7 +4567,6 @@ build_unary_op (code, xarg, noconvert)
|| code == POSTINCREMENT_EXPR)
? PLUS_EXPR : MINUS_EXPR),
argtype, value, inc);
TREE_SIDE_EFFECTS (incremented) = 1;
modify = build_modify_expr (arg, NOP_EXPR, incremented);
compound = build (COMPOUND_EXPR, TREE_TYPE (arg), modify, value);
@ -4605,7 +4604,6 @@ build_unary_op (code, xarg, noconvert)
arg = stabilize_reference (arg);
val = build (MODIFY_EXPR, TREE_TYPE (arg), arg,
boolean_true_node);
TREE_SIDE_EFFECTS (val) = 1;
arg = save_expr (arg);
val = build (COMPOUND_EXPR, TREE_TYPE (arg), val, arg);
val = build (COMPOUND_EXPR, TREE_TYPE (arg), arg, val);
@ -6854,10 +6852,7 @@ check_return_expr (retval)
/* Actually copy the value returned into the appropriate location. */
if (retval && retval != result)
{
retval = build (INIT_EXPR, TREE_TYPE (result), result, retval);
TREE_SIDE_EFFECTS (retval) = 1;
}
retval = build (INIT_EXPR, TREE_TYPE (result), result, retval);
/* All done. Remember that this function did return a value. */
current_function_returns_value = 1;