This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Patch to allow Ada to work with tree-ssa

Richard Kenner wrote:

   In particular, you've just added an extra entry to ARRAY_REF and
   COMPONENT_REF, making these two common tree nodes bigger.
   (COMPONENT_REF, in particular, is used extensively in C++; every
   access to a class member variable is a COMPONENT_REF.)  These extra
   entries are unnecessary in C and C++, meaning that for GCC's two
   most-used languages you've just increased memory usage with no
   benefit.  If you need some additional stuff for Ada, please find a way
   that doesn't penalize C and C++.

Here's the specific test case for C.  I note that it isn't valid C++,
but I don't know C++ well enough to make a similar case there.  Note
that the proposal involving using an INDIRECT_REF won't work with this
case because it's a bitfield.

sub1 (int n)
 struct foo {int arr[n]; int filler : 3; int fld : 4;} x;

return x.fld;

I believe that there are tests cases in GNU C that require the functionality you've added.

However, you've penalized the vastly more common case (100% of the cases in ANSI/ISO C89) at the expense of an uncommon case.

That's why you should find another way -- a different tree code, a flag in the node indicating how many arguments are in use, or stuff the additional arguments into the existing slots by using a TREE_LIST in those slots as necessary.

Mark Mitchell
CodeSourcery, LLC
(916) 791-8304

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]