public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Re:  Why is the TREE_PURPOSE of a CONSTRUCTOR_ELT list for ARRAY_TYPE NULL?
@ 2004-09-06 20:20 Richard Kenner
  0 siblings, 0 replies; 6+ messages in thread
From: Richard Kenner @ 2004-09-06 20:20 UTC (permalink / raw)
  To: dberlin; +Cc: gcc

    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)?

It's a C++ FE bug. Before tree-ssa, TREE_PURPOSE could be (and often was)
NULL, but it can't be now.

^ permalink raw reply	[flat|nested] 6+ messages in thread
* Why is the TREE_PURPOSE of a CONSTRUCTOR_ELT list for ARRAY_TYPE NULL?
@ 2004-09-06 19:55 Daniel Berlin
  2004-09-07 20:03 ` Richard Henderson
  0 siblings, 1 reply; 6+ messages in thread
From: Daniel Berlin @ 2004-09-06 19:55 UTC (permalink / raw)
  To: gcc

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 :)



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2004-09-08 21:41 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-09-06 20:20 Why is the TREE_PURPOSE of a CONSTRUCTOR_ELT list for ARRAY_TYPE NULL? Richard Kenner
  -- strict thread matches above, loose matches on Subject: below --
2004-09-06 19:55 Daniel Berlin
2004-09-07 20:03 ` Richard Henderson
2004-09-08 20:49   ` Mark Mitchell
2004-09-08 21:35     ` Joseph S. Myers
2004-09-08 21:41       ` Mark Mitchell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).