diff options
| author | mmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4> | 1999-09-15 06:09:53 +0000 |
|---|---|---|
| committer | mmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4> | 1999-09-15 06:09:53 +0000 |
| commit | 775f41da54bc198668dc79bba36e8f69cbd613f0 (patch) | |
| tree | 634dafd7ae201fdd23c6c986014764530e0e8a7d | |
| parent | 8df286ec1236aa6c778e634517ee32005d4bdf74 (diff) | |
| download | ppe42-gcc-775f41da54bc198668dc79bba36e8f69cbd613f0.tar.gz ppe42-gcc-775f41da54bc198668dc79bba36e8f69cbd613f0.zip | |
* decl.c (build_target_expr): Set TREE_SIDE_EFFECTS on the
TARGET_EXPR.
* call.c (build_over_call): Don't set TREE_SIDE_EFFECTS on
the TARGET_EXPR.
* cvt.c (build_up_reference): Likewise.
* tree.c (build_cplus_new): Likewise.
(get_target_expr): Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@29426 138bc75d-0d04-0410-961f-82ee72b054a4
| -rw-r--r-- | gcc/cp/ChangeLog | 10 | ||||
| -rw-r--r-- | gcc/cp/call.c | 1 | ||||
| -rw-r--r-- | gcc/cp/cvt.c | 1 | ||||
| -rw-r--r-- | gcc/cp/decl.c | 13 | ||||
| -rw-r--r-- | gcc/cp/tree.c | 2 |
5 files changed, 21 insertions, 6 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 4addb631c2b..9697001144a 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,13 @@ +1999-09-14 Mark Mitchell <mark@codesourcery.com> + + * decl.c (build_target_expr): Set TREE_SIDE_EFFECTS on the + TARGET_EXPR. + * call.c (build_over_call): Don't set TREE_SIDE_EFFECTS on + the TARGET_EXPR. + * cvt.c (build_up_reference): Likewise. + * tree.c (build_cplus_new): Likewise. + (get_target_expr): Likewise. + Tue Sep 14 01:45:10 1999 Marc Espie <espie@cvs.openbsd.org> * Makefile.in: Prepend $(SHELL) to move-if-change calls. diff --git a/gcc/cp/call.c b/gcc/cp/call.c index bce17412eab..4c9cdb8a02f 100644 --- a/gcc/cp/call.c +++ b/gcc/cp/call.c @@ -4038,7 +4038,6 @@ build_over_call (cand, args, flags) { val = build_decl (VAR_DECL, NULL_TREE, DECL_CONTEXT (fn)); val = build_target_expr (val, arg); - TREE_SIDE_EFFECTS (val) = 1; return val; } } diff --git a/gcc/cp/cvt.c b/gcc/cp/cvt.c index d1bdb2e83f8..79968a86869 100644 --- a/gcc/cp/cvt.c +++ b/gcc/cp/cvt.c @@ -365,7 +365,6 @@ build_up_reference (type, arg, flags) tree slot = build_decl (VAR_DECL, NULL_TREE, argtype); DECL_ARTIFICIAL (slot) = 1; arg = build_target_expr (slot, arg); - TREE_SIDE_EFFECTS (arg) = 1; } /* If we had a way to wrap this up, and say, if we ever needed it's diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index af4bf137aa8..789fe4e9445 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -14127,8 +14127,17 @@ build_target_expr (decl, value) tree decl; tree value; { - return build (TARGET_EXPR, TREE_TYPE (decl), decl, value, - maybe_build_cleanup (decl), NULL_TREE); + tree t; + + t = build (TARGET_EXPR, TREE_TYPE (decl), decl, value, + maybe_build_cleanup (decl), NULL_TREE); + /* We always set TREE_SIDE_EFFECTS so that expand_expr does not + ignore the TARGET_EXPR. If there really turn out to be no + side-effects, then the optimizer should be able to get rid of + whatever code is generated anyhow. */ + TREE_SIDE_EFFECTS (t) = 1; + + return t; } /* If DECL is of a type which needs a cleanup, build that cleanup diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c index f0f014119d1..48425ed1e5d 100644 --- a/gcc/cp/tree.c +++ b/gcc/cp/tree.c @@ -252,7 +252,6 @@ build_cplus_new (type, init) && TREE_CODE (TREE_OPERAND (fn, 0)) == FUNCTION_DECL && DECL_CONSTRUCTOR_P (TREE_OPERAND (fn, 0))); rval = build_target_expr (slot, rval); - TREE_SIDE_EFFECTS (rval) = 1; return rval; } @@ -270,7 +269,6 @@ get_target_expr (init) DECL_ARTIFICIAL (slot) = 1; layout_decl (slot, 0); rval = build_target_expr (slot, init); - TREE_SIDE_EFFECTS (rval) = 1; return rval; } |

