Commit c557501d by Mark Mitchell Committed by Mark Mitchell

call.c (build_over_call): Don't set TREE_SIDE_EFFECTS for situations where…

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
parent 783feeb0
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> 1999-10-04 Jason Merrill <jason@yorick.cygnus.com>
* init.c (build_vec_delete_1): Fold COND_EXPRs. * init.c (build_vec_delete_1): Fold COND_EXPRs.
......
...@@ -4066,7 +4066,6 @@ build_over_call (cand, args, flags) ...@@ -4066,7 +4066,6 @@ build_over_call (cand, args, flags)
val = build (is_empty_class (DECL_CLASS_CONTEXT (fn)) val = build (is_empty_class (DECL_CLASS_CONTEXT (fn))
? MODIFY_EXPR : INIT_EXPR, ? MODIFY_EXPR : INIT_EXPR,
DECL_CONTEXT (fn), to, arg); DECL_CONTEXT (fn), to, arg);
TREE_SIDE_EFFECTS (val) = 1;
address = build_unary_op (ADDR_EXPR, val, 0); address = build_unary_op (ADDR_EXPR, val, 0);
/* Avoid a warning about this expression, if the address is /* Avoid a warning about this expression, if the address is
never used. */ never used. */
...@@ -4084,7 +4083,6 @@ build_over_call (cand, args, flags) ...@@ -4084,7 +4083,6 @@ build_over_call (cand, args, flags)
arg = build_indirect_ref (TREE_VALUE (TREE_CHAIN (converted_args)), 0); arg = build_indirect_ref (TREE_VALUE (TREE_CHAIN (converted_args)), 0);
val = build (MODIFY_EXPR, TREE_TYPE (to), to, arg); val = build (MODIFY_EXPR, TREE_TYPE (to), to, arg);
TREE_SIDE_EFFECTS (val) = 1;
return val; return val;
} }
......
...@@ -6999,9 +6999,6 @@ grok_reference_init (decl, type, init) ...@@ -6999,9 +6999,6 @@ grok_reference_init (decl, type, init)
{ {
/* Initialize the declaration. */ /* Initialize the declaration. */
tmp = build (INIT_EXPR, TREE_TYPE (decl), decl, tmp); 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); finish_expr_stmt (tmp);
} }
else else
...@@ -8028,12 +8025,9 @@ expand_static_init (decl, init) ...@@ -8028,12 +8025,9 @@ expand_static_init (decl, init)
|| (init && TREE_CODE (init) == TREE_LIST)) || (init && TREE_CODE (init) == TREE_LIST))
assignment = build_aggr_init (decl, init, 0); assignment = build_aggr_init (decl, init, 0);
else if (init) else if (init)
{ /* The initialization we're doing here is just a bitwise
/* The initialization we're doing here is just a bitwise copy. */
copy. */ assignment = build (INIT_EXPR, TREE_TYPE (decl), decl, init);
assignment = build (INIT_EXPR, TREE_TYPE (decl), decl, init);
TREE_SIDE_EFFECTS (assignment) = 1;
}
else else
assignment = NULL_TREE; assignment = NULL_TREE;
......
...@@ -149,7 +149,6 @@ perform_member_init (member, name, init, explicit) ...@@ -149,7 +149,6 @@ perform_member_init (member, name, init, explicit)
if (ANON_AGGR_TYPE_P (type)) if (ANON_AGGR_TYPE_P (type))
{ {
init = build (INIT_EXPR, type, decl, TREE_VALUE (init)); init = build (INIT_EXPR, type, decl, TREE_VALUE (init));
TREE_SIDE_EFFECTS (init) = 1;
finish_expr_stmt (init); finish_expr_stmt (init);
} }
else if (TYPE_NEEDS_CONSTRUCTING (type) else if (TYPE_NEEDS_CONSTRUCTING (type)
...@@ -1247,11 +1246,7 @@ expand_aggr_init_1 (binfo, true_exp, exp, init, flags) ...@@ -1247,11 +1246,7 @@ expand_aggr_init_1 (binfo, true_exp, exp, init, flags)
expand_decl_init (exp); expand_decl_init (exp);
} }
else else
{ finish_expr_stmt (build (INIT_EXPR, type, exp, init));
tree t = build (INIT_EXPR, type, exp, init);
TREE_SIDE_EFFECTS (t) = 1;
finish_expr_stmt (t);
}
return; return;
} }
...@@ -2271,7 +2266,6 @@ build_new_1 (exp) ...@@ -2271,7 +2266,6 @@ build_new_1 (exp)
build_component_ref (cookie, nelts_identifier, build_component_ref (cookie, nelts_identifier,
NULL_TREE, 0), NULL_TREE, 0),
nelts); nelts);
TREE_SIDE_EFFECTS (exp1) = 1;
rval = cp_convert (build_pointer_type (true_type), rval); rval = cp_convert (build_pointer_type (true_type), rval);
rval = build_compound_expr rval = build_compound_expr
(tree_cons (NULL_TREE, exp1, (tree_cons (NULL_TREE, exp1,
...@@ -2424,7 +2418,6 @@ build_new_1 (exp) ...@@ -2424,7 +2418,6 @@ build_new_1 (exp)
end = build (MODIFY_EXPR, TREE_TYPE (sentry), end = build (MODIFY_EXPR, TREE_TYPE (sentry),
sentry, boolean_false_node); sentry, boolean_false_node);
TREE_SIDE_EFFECTS (end) = 1;
buf = TREE_OPERAND (rval, 0); buf = TREE_OPERAND (rval, 0);
......
...@@ -2188,7 +2188,6 @@ do_build_copy_constructor (fndecl) ...@@ -2188,7 +2188,6 @@ do_build_copy_constructor (fndecl)
else if (TYPE_HAS_TRIVIAL_INIT_REF (current_class_type)) else if (TYPE_HAS_TRIVIAL_INIT_REF (current_class_type))
{ {
t = build (INIT_EXPR, void_type_node, current_class_ref, parm); t = build (INIT_EXPR, void_type_node, current_class_ref, parm);
TREE_SIDE_EFFECTS (t) = 1;
finish_expr_stmt (t); finish_expr_stmt (t);
} }
else else
...@@ -2270,7 +2269,6 @@ do_build_assign_ref (fndecl) ...@@ -2270,7 +2269,6 @@ do_build_assign_ref (fndecl)
else if (TYPE_HAS_TRIVIAL_ASSIGN_REF (current_class_type)) else if (TYPE_HAS_TRIVIAL_ASSIGN_REF (current_class_type))
{ {
tree t = build (MODIFY_EXPR, void_type_node, current_class_ref, parm); tree t = build (MODIFY_EXPR, void_type_node, current_class_ref, parm);
TREE_SIDE_EFFECTS (t) = 1;
finish_expr_stmt (t); finish_expr_stmt (t);
} }
else else
......
...@@ -2680,7 +2680,6 @@ expand_upcast_fixups (binfo, addr, orig_addr, vbase, vbase_addr, t, ...@@ -2680,7 +2680,6 @@ expand_upcast_fixups (binfo, addr, orig_addr, vbase, vbase_addr, t,
init = build (MODIFY_EXPR, TREE_TYPE (nvtbl), init = build (MODIFY_EXPR, TREE_TYPE (nvtbl),
nvtbl, vtbl); nvtbl, vtbl);
TREE_SIDE_EFFECTS (init) = 1;
finish_expr_stmt (init); finish_expr_stmt (init);
/* Update the vtable pointers as necessary. */ /* Update the vtable pointers as necessary. */
ref = build_vfield_ref ref = build_vfield_ref
......
...@@ -1356,11 +1356,7 @@ finish_stmt_expr (rtl_expr) ...@@ -1356,11 +1356,7 @@ finish_stmt_expr (rtl_expr)
tree result; tree result;
if (!building_stmt_tree ()) if (!building_stmt_tree ())
{ rtl_expr = expand_end_stmt_expr (rtl_expr);
rtl_expr = expand_end_stmt_expr (rtl_expr);
/* The statements have side effects, so the group does too. */
TREE_SIDE_EFFECTS (rtl_expr) = 1;
}
if (building_stmt_tree ()) if (building_stmt_tree ())
{ {
......
...@@ -4567,7 +4567,6 @@ build_unary_op (code, xarg, noconvert) ...@@ -4567,7 +4567,6 @@ build_unary_op (code, xarg, noconvert)
|| code == POSTINCREMENT_EXPR) || code == POSTINCREMENT_EXPR)
? PLUS_EXPR : MINUS_EXPR), ? PLUS_EXPR : MINUS_EXPR),
argtype, value, inc); argtype, value, inc);
TREE_SIDE_EFFECTS (incremented) = 1;
modify = build_modify_expr (arg, NOP_EXPR, incremented); modify = build_modify_expr (arg, NOP_EXPR, incremented);
compound = build (COMPOUND_EXPR, TREE_TYPE (arg), modify, value); compound = build (COMPOUND_EXPR, TREE_TYPE (arg), modify, value);
...@@ -4605,7 +4604,6 @@ build_unary_op (code, xarg, noconvert) ...@@ -4605,7 +4604,6 @@ build_unary_op (code, xarg, noconvert)
arg = stabilize_reference (arg); arg = stabilize_reference (arg);
val = build (MODIFY_EXPR, TREE_TYPE (arg), arg, val = build (MODIFY_EXPR, TREE_TYPE (arg), arg,
boolean_true_node); boolean_true_node);
TREE_SIDE_EFFECTS (val) = 1;
arg = save_expr (arg); arg = save_expr (arg);
val = build (COMPOUND_EXPR, TREE_TYPE (arg), val, arg); val = build (COMPOUND_EXPR, TREE_TYPE (arg), val, arg);
val = build (COMPOUND_EXPR, TREE_TYPE (arg), arg, val); val = build (COMPOUND_EXPR, TREE_TYPE (arg), arg, val);
...@@ -6854,10 +6852,7 @@ check_return_expr (retval) ...@@ -6854,10 +6852,7 @@ check_return_expr (retval)
/* Actually copy the value returned into the appropriate location. */ /* Actually copy the value returned into the appropriate location. */
if (retval && retval != result) if (retval && retval != result)
{ retval = build (INIT_EXPR, TREE_TYPE (result), result, retval);
retval = build (INIT_EXPR, TREE_TYPE (result), result, retval);
TREE_SIDE_EFFECTS (retval) = 1;
}
/* All done. Remember that this function did return a value. */ /* All done. Remember that this function did return a value. */
current_function_returns_value = 1; current_function_returns_value = 1;
......
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