This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
PATCH for expr.c and TYPE_NONCOPIED_PARTS
- To: egcs-patches at egcs dot cygnus dot com
- Subject: PATCH for expr.c and TYPE_NONCOPIED_PARTS
- From: Mark Mitchell <mark at codesourcery dot com>
- Date: Sun, 2 May 1999 22:43:40 -0700
- Reply-to: mark at codesourcery dot com
This patch fixes the documentation in tree.def for
TYPE_NONCOPIED_PARTS; what's there now does not in any way correspond
to reality. It also adds a minor feature to init_noncopied_parts;
namely, that a non-copied part which does not need initialization is
not explicitly initialized. We need this new functionality to fix a
code-gen bug in the C++ front-end.
OK?
--
Mark Mitchell mark@codesourcery.com
CodeSourcery, LLC http://www.codesourcery.com
Sun May 2 22:40:00 1999 Mark Mitchell <mark@codesourcery.com>
* tree.def (TYPE_NONCOPIED_PARTS): Revise documentation to match
reality.
* expr.c (init_noncopied_parts): Don't generate initializers for
parts that don't need them.
Index: tree.def
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/tree.def,v
retrieving revision 1.20
diff -u -p -r1.20 tree.def
--- tree.def 1999/04/19 18:16:33 1.20
+++ tree.def 1999/05/03 00:49:03
@@ -98,8 +98,14 @@ DEFTREECODE (BLOCK, "block", 'b', 0)
points to the start of the chain.
The TYPE_NONCOPIED_PARTS field is a list specifying which parts
of an object of this type should *not* be copied by assignment.
- The TREE_PURPOSE of each element is the offset of the part
- and the TREE_VALUE is the size in bits of the part.
+ The TREE_VALUE of each is a FIELD_DECL that should not be
+ copied. The TREE_PURPOSE is an initial value for that field when
+ an object of this type is initialized via an INIT_EXPR. It may
+ be NULL if no special value is required. Even the things in this
+ list are copied if the right-hand side of an assignment is known
+ to be a complete object (rather than being, perhaps, a subobject
+ of some other object.) The determination of what constitutes a
+ complete object is done by fixed_type_p.
The TYPE_NAME field contains info on the name used in the program
for this type (for GDB symbol table output). It is either a
TYPE_DECL node, for types that are typedefs, or an IDENTIFIER_NODE
Index: expr.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/expr.c,v
retrieving revision 1.142
diff -u -p -r1.142 expr.c
--- expr.c 1999/04/29 23:01:28 1.142
+++ expr.c 1999/05/03 00:49:02
@@ -5097,7 +5097,7 @@ init_noncopied_parts (lhs, list)
for (tail = list; tail; tail = TREE_CHAIN (tail))
if (TREE_CODE (TREE_VALUE (tail)) == TREE_LIST)
parts = chainon (parts, init_noncopied_parts (lhs, TREE_VALUE (tail)));
- else
+ else if (TREE_PURPOSE (tail))
{
tree part = TREE_VALUE (tail);
tree part_type = TREE_TYPE (part);