public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Mark Mitchell <mark@codesourcery.com>
To: "Joseph S. Myers" <jsm@polyomino.org.uk>
Cc: Richard Henderson <rth@redhat.com>,
	 Daniel Berlin <dberlin@dberlin.org>,
	gcc@gcc.gnu.org
Subject: Re: Why is the TREE_PURPOSE of a CONSTRUCTOR_ELT list for ARRAY_TYPE NULL?
Date: Wed, 08 Sep 2004 21:41:00 -0000	[thread overview]
Message-ID: <413F7C68.9040909@codesourcery.com> (raw)
In-Reply-To: <Pine.LNX.4.61.0409082121380.22259@digraph.polyomino.org.uk>

Joseph S. Myers wrote:

>On Wed, 8 Sep 2004, Mark Mitchell wrote:
>
>  
>
>>In fact, I've been thinking that we should design a new datastructure for
>>CONTRUCTORs like so:
>>
>> struct initializer_chunk {
>>    tree base;
>>    tree count;
>>    struct initializer_chunk *next;
>>    tree *elems[1];
>> };
>>
>>with the idea of making these initializers vastly more compact.
>>
>>Yes, this is only a constant-factor improvement, but on test cases with large
>>arrays (of which there are plenty) this could very well result in the
>>difference between fitting in RAM and not fitting in RAM.
>>    
>>
>
>Perhaps we should also call them something other than CONSTRUCTOR, given 
>the several different meanings that word has.
>  
>
Yes.

>I wonder if the common case is that large initializers are mostly 
>compile-time constants so all you need store is an array of target bytes 
>(at the expense of greater complexity when you then want to extract a 
>particular constant element).
>  
>
I think that is probably the common case for very large initializers 
(big bitmaps, data tables, etc).  So, you're right that this might make 
sense.   However, sometimes there are relocations against these 
constants because they're runtime constants, rather than compile-time 
constants.  Virtual tables, with their pointers-to-functions, are in 
this category.  

So, I'd still go with my suggestion as a first cut; then, you could add 
a discriminator bit and turn elems into a union member with "byte_t 
*data" as the other element in the union.

-- 
Mark Mitchell
CodeSourcery, LLC
(916) 791-8304
mark@codesourcery.com

  reply	other threads:[~2004-09-08 21:41 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 message]
2004-09-06 20:20 Richard Kenner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=413F7C68.9040909@codesourcery.com \
    --to=mark@codesourcery.com \
    --cc=dberlin@dberlin.org \
    --cc=gcc@gcc.gnu.org \
    --cc=jsm@polyomino.org.uk \
    --cc=rth@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).