* tree-inline.c (copy_body_r): Unshare the substituted value first.
* g++.dg/tree-ssa/pr24172.C: New testcase.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@106247
138bc75d-0d04-0410-961f-
82ee72b054a4
+2005-10-30 Jan Hubicka <jh@suse.cz>
+
+ PR tree-optimization/24172
+ * tree-inline.c (copy_body_r): Unshare the substituted value first.
+
2005-10-30 Hans-Peter Nilsson <hp@bitrange.com>
* config/mmix/mmix.c (mmix_intval): Correct handling of DFmode
2005-10-30 Hans-Peter Nilsson <hp@bitrange.com>
* config/mmix/mmix.c (mmix_intval): Correct handling of DFmode
+2005-10-30 Jan Hubicka <jh@suse.cz>
+
+ * g++.dg/tree-ssa/pr24172.C: New testcase.
+
2005-10-30 Tobias Schl"uter <tobias.schlueter@physik.uni-muenchen.de>
* gfortran.dg/enum_10.f90, gfortran.dg/enum_10.c: New test.
2005-10-30 Tobias Schl"uter <tobias.schlueter@physik.uni-muenchen.de>
* gfortran.dg/enum_10.f90, gfortran.dg/enum_10.c: New test.
--- /dev/null
+// { dg-options "-O2" }
+void IOException( char);
+inline int* dummy( const char* const mode )
+{
+ IOException(*mode+*mode);
+}
+
+void prepare_inpaint( )
+{
+ dummy ("rb");
+}
n = splay_tree_lookup (id->decl_map, (splay_tree_key) decl);
if (n)
{
n = splay_tree_lookup (id->decl_map, (splay_tree_key) decl);
if (n)
{
/* If we happen to get an ADDR_EXPR in n->value, strip
it manually here as we'll eventually get ADDR_EXPRs
which lie about their types pointed to. In this case
/* If we happen to get an ADDR_EXPR in n->value, strip
it manually here as we'll eventually get ADDR_EXPRs
which lie about their types pointed to. In this case
but we absolutely rely on that. As fold_indirect_ref
does other useful transformations, try that first, though. */
tree type = TREE_TYPE (TREE_TYPE ((tree)n->value));
but we absolutely rely on that. As fold_indirect_ref
does other useful transformations, try that first, though. */
tree type = TREE_TYPE (TREE_TYPE ((tree)n->value));
- *tp = fold_indirect_ref_1 (type, (tree)n->value);
+ new = unshare_expr ((tree)n->value);
+ *tp = fold_indirect_ref_1 (type, new);
- if (TREE_CODE ((tree)n->value) == ADDR_EXPR)
- *tp = TREE_OPERAND ((tree)n->value, 0);
+ if (TREE_CODE (new) == ADDR_EXPR)
+ *tp = TREE_OPERAND (new, 0);
- *tp = build1 (INDIRECT_REF, type, (tree)n->value);
+ *tp = build1 (INDIRECT_REF, type, new);
}
*walk_subtrees = 0;
return NULL;
}
*walk_subtrees = 0;
return NULL;