This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [tree-ssa] Fix memory problems with large jumpy functions[patch]
- From: Jason Merrill <jason at redhat dot com>
- To: Diego Novillo <dnovillo at redhat dot com>
- Cc: Michael Matz <matz at suse dot de>,"gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 11 Sep 2002 13:14:55 +0100
- Subject: Re: [tree-ssa] Fix memory problems with large jumpy functions[patch]
- References: <Pine.LNX.4.33.0209111306570.20255-100000@wotan.suse.de><1031745998.8008.65.camel@frodo>
On 11 Sep 2002 08:06:38 -0400, Diego Novillo <dnovillo@redhat.com> wrote:
> On Wed, 2002-09-11 at 07:19, Michael Matz wrote:
>> Hi,
>>
>> On Tue, 10 Sep 2002, Diego Novillo wrote:
>>
>> > - The basic tree_ref structure had several field that are not
>> > always used by every type of reference. This patch separates
>> > them into different structures. I think that we should move
>> > away from having a generic tree_ref union, lest we fall in the
>> > same trap we fell with trees.
>> >
>> > However, we do need generic containers for references. I guess
>> > we could use void * containers, but that's a bit on the gross
>> > side. Any other ideas on how we could deal with this?
>>
>> As you anyway would need to cast that void* every time, you can as well do
>> everything type- and alias-safe, like e.g.:
>>
> Hmmm, this is *exactly* what we have today (see tree-flow.h). The
> problem is (a) the aggregated union is rather large (52 bytes on
> x86-32)
But you never create an object of that union, do you?
In any case, as I mentioned the other day, the other alternative is to have
struct A_common {
int type;
/* ... other common fields ... */
};
struct A1 {
struct A_common base;
int whatever_a1;
/* More A1 specific fields ... */
};
and hand around A_common*. This is more C++-like.
Jason