This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
PATCH to nullify TREE_CHAIN for an EXPR_WITH_FILE_LOCATION
- To: gcc-patches at gcc dot gnu dot org
- Subject: PATCH to nullify TREE_CHAIN for an EXPR_WITH_FILE_LOCATION
- From: Mark Mitchell <mark at codesourcery dot com>
- Date: Thu, 9 Dec 1999 11:12:40 -0800
- Reply-to: mark at codesourcery dot com
Until recently, EXPR_WITH_FILE_LOCATION abused tree semantics by
storing the filename in its TREE_CHAIN. That's wrong; expression
nodes should not use their TREE_CHAINs for any purpose. Otherwise,
they cannot be chained together as function-aguments, etc.
When I fixed this, however, I neglected to spot this special-casing of
EXPR_WITH_FILE_LOCATION in copy_node.
BTW, it turns out that the previous change broke the Java front-end,
which used EXPR_WITH_FILE_LOCATION in some undocumented ways. I've
been discussing, in private email, the possible fixes with the Java
folks. Hopefully, that will be resolved shortly.
--
Mark Mitchell mark@codesourcery.com
CodeSourcery, LLC http://www.codesourcery.com
1999-12-09 Mark Mitchell <mark@codesourcery.com>
* tree.c (copy_node): Do zero the TREE_CHAIN, even for an
EXPR_WITH_FILE_LOCATION.
Index: tree.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/tree.c,v
retrieving revision 1.106
diff -c -p -r1.106 tree.c
*** tree.c 1999/11/25 16:14:00 1.106
--- tree.c 1999/12/09 18:50:41
*************** copy_node (node)
*** 1191,1199 ****
t = (tree) obstack_alloc (current_obstack, length);
memcpy (t, node, length);
! /* EXPR_WITH_FILE_LOCATION must keep filename info stored in TREE_CHAIN */
! if (TREE_CODE (node) != EXPR_WITH_FILE_LOCATION)
! TREE_CHAIN (t) = 0;
TREE_ASM_WRITTEN (t) = 0;
if (TREE_CODE_CLASS (code) == 'd')
--- 1191,1197 ----
t = (tree) obstack_alloc (current_obstack, length);
memcpy (t, node, length);
! TREE_CHAIN (t) = 0;
TREE_ASM_WRITTEN (t) = 0;
if (TREE_CODE_CLASS (code) == 'd')