This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Why is the TREE_PURPOSE of a CONSTRUCTOR_ELT list for ARRAY_TYPENULL?
- From: Daniel Berlin <dberlin at dberlin dot org>
- To: gcc at gcc dot gnu dot org
- Date: Mon, 06 Sep 2004 15:55:49 -0400
- Subject: Why is the TREE_PURPOSE of a CONSTRUCTOR_ELT list for ARRAY_TYPENULL?
The documentation claims:
For ARRAY_TYPE:
The TREE_PURPOSE of each node is the corresponding index.
If the TREE_PURPOSE is a RANGE_EXPR, it is a short-hand for many
nodes,
one for each index in the range. (If the corresponding TREE_VALUE
has side-effects, they are evaluated once for each element. Wrap the
value in a SAVE_EXPR if you want to evaluate side effects only once.)
Nothing in there says it could be NULL.
Except in the constructors i'm dealing with (C++ vtables, represented as
arrays), all the TREE_PURPOSES in the constructor list are NULL.
Does that mean that the corresponding index is the last index + 1?
In any case, is this a documentation bug, or a C++ FE bug (IE should i
expect tree_purpose to always be there, and it's just not getting set in
the case of the C vtables, or do the docs need updating)?
I'm trying to figure out whether i need to submit a patch to the
documentation, or the C++ FE :)