+2004-12-15 Eric Botcazou <ebotcazou@libertysurf.fr>
+
+ PR c++/17972
+ * tree-inline.c (expand_call_inline): Set TREE_SIDE_EFFECTS
+ on the STMT_EXPR wrapping up the inlined body.
+
2004-12-15 Vladimir Makarov <vmakarov@redhat.com>
Steven Bosscher <stevenb@suse.de>
PR middle end/17340
+2004-12-15 Alan Modra <amodra@bigpond.net.au>
+
+ * g++.dg/opt/inline9.C: New test.
+
2004-12-15 Tobias Schlueter <tobias.schlueter@physik.uni-muenchen.de>
PR fortran/18993
--- /dev/null
+// PR c++/17972
+// Origin: Michal Ostrowski <mostrows@watson.ibm.com>
+// Testcase by Alan Modra <amodra@bigpond.net.au>
+// { dg-do run }
+// { dg-options "-O" }
+// { dg-options "-O -mtune=i686" { target i?86-*-* } }
+
+struct thread_info
+{
+ short preempt_count;
+} x;
+
+static inline struct thread_info *cti (void) __attribute__ ((const));
+static inline struct thread_info *cti (void)
+{
+ return &x;
+}
+
+void fn (void) __attribute__ ((noinline));
+void fn (void)
+{
+ ++cti()->preempt_count;
+}
+
+int main (void)
+{
+ fn ();
+ return 0;
+}
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);