This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/24172] [4.1 Regression] error: incorrect sharing of tree nodes
- From: "rguenth at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 4 Oct 2005 10:44:04 -0000
- Subject: [Bug tree-optimization/24172] [4.1 Regression] error: incorrect sharing of tree nodes
- References: <bug-24172-11423@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #5 from rguenth at gcc dot gnu dot org 2005-10-04 10:44 -------
The problem is, that with this part of the blamed patch
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-inline.c,v
retrieving revision 1.182
retrieving revision 1.183
diff -u -r1.182 -r1.183
--- gcc/gcc/tree-inline.c 2005/04/23 21:27:58 1.182
+++ gcc/gcc/tree-inline.c 2005/05/13 13:56:54 1.183
@@ -566,21 +566,15 @@
{
/* Get rid of *& from inline substitutions that can happen when a
pointer argument is an ADDR_EXPR. */
- tree decl = TREE_OPERAND (*tp, 0), value;
+ tree decl = TREE_OPERAND (*tp, 0);
splay_tree_node n;
n = splay_tree_lookup (id->decl_map, (splay_tree_key) decl);
if (n)
{
- value = (tree) n->value;
- STRIP_NOPS (value);
- if (TREE_CODE (value) == ADDR_EXPR
- && (lang_hooks.types_compatible_p
- (TREE_TYPE (*tp), TREE_TYPE (TREE_OPERAND (value, 0)))))
- {
- *tp = TREE_OPERAND (value, 0);
- return copy_body_r (tp, walk_subtrees, data);
- }
+ *tp = build_fold_indirect_ref ((tree)n->value);
+ *walk_subtrees = 0;
+ return NULL;
}
}
we do not have *tp unshared anymore. Is build_fold_indirect_ref supposed
to do that?
Anyway, I'll test the following:
Index: tree-inline.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-inline.c,v
retrieving revision 1.210
diff -c -3 -p -r1.210 tree-inline.c
*** tree-inline.c 1 Aug 2005 15:25:28 -0000 1.210
--- tree-inline.c 4 Oct 2005 10:43:23 -0000
*************** copy_body_r (tree *tp, int *walk_subtree
*** 636,643 ****
else
*tp = build1 (INDIRECT_REF, type, (tree)n->value);
}
! *walk_subtrees = 0;
! return NULL;
}
}
--- 636,642 ----
else
*tp = build1 (INDIRECT_REF, type, (tree)n->value);
}
! /* Fall through to copying the folded tree. */
}
}
--
rguenth at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |rguenth at gcc dot gnu dot
|dot org |org
Status|NEW |ASSIGNED
Last reconfirmed|2005-10-03 16:54:18 |2005-10-04 10:44:04
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24172