aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>1999-10-04 09:15:17 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>1999-10-04 09:15:17 +0000
commitc557501d33029a97f01105f220131e9b2516f0c1 (patch)
tree575945e66d009b12d2588f1e5975f2ea2bed86ff
parent783feeb0345506e257cc83d5dd1c8ac7b359cbf8 (diff)
downloadgcc-c557501d33029a97f01105f220131e9b2516f0c1.zip
gcc-c557501d33029a97f01105f220131e9b2516f0c1.tar.gz
gcc-c557501d33029a97f01105f220131e9b2516f0c1.tar.bz2
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
-rw-r--r--gcc/cp/ChangeLog17
-rw-r--r--gcc/cp/call.c2
-rw-r--r--gcc/cp/decl.c12
-rw-r--r--gcc/cp/init.c9
-rw-r--r--gcc/cp/method.c2
-rw-r--r--gcc/cp/search.c1
-rw-r--r--gcc/cp/semantics.c6
-rw-r--r--gcc/cp/typeck.c7
8 files changed, 23 insertions, 33 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 21ea589..03d2b1a 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -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.
diff --git a/gcc/cp/call.c b/gcc/cp/call.c
index 8cbc9dd..5d9f5c3 100644
--- a/gcc/cp/call.c
+++ b/gcc/cp/call.c
@@ -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;
}
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 9c51069..2ab2a86 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -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;
diff --git a/gcc/cp/init.c b/gcc/cp/init.c
index e6a1c5f..0bd2740 100644
--- a/gcc/cp/init.c
+++ b/gcc/cp/init.c
@@ -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);
diff --git a/gcc/cp/method.c b/gcc/cp/method.c
index b2daeb2..8cb4eb3 100644
--- a/gcc/cp/method.c
+++ b/gcc/cp/method.c
@@ -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
diff --git a/gcc/cp/search.c b/gcc/cp/search.c
index 2b31af0..a8e8ac1 100644
--- a/gcc/cp/search.c
+++ b/gcc/cp/search.c
@@ -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
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index eb1767e..eb94da0 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -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 ())
{
diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c
index 5395d7d..2b766d6 100644
--- a/gcc/cp/typeck.c
+++ b/gcc/cp/typeck.c
@@ -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;