aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-inline.c
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@gcc.gnu.org>2004-12-15 19:14:55 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2004-12-15 19:14:55 +0000
commit774a9b00ca266a7ce1abbd4d59d6470598256401 (patch)
treea18fec77f84f3bf26eb79a6bc22ae87ad38cfa21 /gcc/tree-inline.c
parent172b87995cadacf87ba6ce1517b8a49acc3db0ae (diff)
downloadgcc-774a9b00ca266a7ce1abbd4d59d6470598256401.zip
gcc-774a9b00ca266a7ce1abbd4d59d6470598256401.tar.gz
gcc-774a9b00ca266a7ce1abbd4d59d6470598256401.tar.bz2
re PR c++/17972 (const/pure functions result in bad asm)
PR c++/17972 * tree-inline.c (expand_call_inline): Set TREE_SIDE_EFFECTS on the STMT_EXPR wrapping up the inlined body. From-SVN: r92210
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 db2b236..61fe66d 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);