summaryrefslogtreecommitdiff
path: root/gcc/tree-inline.c
diff options
context:
space:
mode:
authorebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>2004-12-15 19:14:55 +0000
committerebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>2004-12-15 19:14:55 +0000
commitb6bdd09f1e536c5e63721c40e4d5571b9af34572 (patch)
treea18fec77f84f3bf26eb79a6bc22ae87ad38cfa21 /gcc/tree-inline.c
parentefc20cc91bc7b1be30bf9c6e4f8cef89c6ca1323 (diff)
downloadgcc-b6bdd09f1e536c5e63721c40e4d5571b9af34572.tar.gz
PR c++/17972
* tree-inline.c (expand_call_inline): Set TREE_SIDE_EFFECTS on the STMT_EXPR wrapping up the inlined body. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@92210 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-inline.c')
-rw-r--r--gcc/tree-inline.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c
index db2b2361874..61fe66dbb08 100644
--- a/gcc/tree-inline.c
+++ b/gcc/tree-inline.c
@@ -1625,8 +1625,11 @@ expand_call_inline (tree *tp, int *walk_subtrees, void *data)
splay_tree_delete (id->decl_map);
id->decl_map = st;
- /* The new expression has side-effects if the old one did. */
- TREE_SIDE_EFFECTS (expr) = TREE_SIDE_EFFECTS (t);
+ /* Although, from the semantic viewpoint, the new expression has
+ side-effects only if the old one did, it is not possible, from
+ the technical viewpoint, to evaluate the body of a function
+ multiple times without serious havoc. */
+ TREE_SIDE_EFFECTS (expr) = 1;
tsi_link_before (&id->tsi, expr, TSI_SAME_STMT);