This is the mail archive of the gcc-patches@gcc.gnu.org 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: [gc-improv] Permanent vs function RTL obstack fix


On Fri, Apr 8, 2011 at 4:36 PM, Jeff Law <law@redhat.com> wrote:
>>> Perhaps a third, per-translation-unit obstack is necessary?
>>
>> Perhaps. After I finish with permanent rtl obstack, I will measure how
>> large it gets and if it's worthwhile to split out
>> per-translation-obstack out of it.
> And then you'll want a per-statement obstack, then per-expression
> obstack, and before you know it, GCC looks much like it did 20 years ago.

I don't think that's a fair comment, or a real concern. Unlike 20
years ago, GCC now has a reasonable idea of how long RTX objects live.
I can think of only four states for RTX in memory:

1. RTL that lives throughout the compilation, things like shared
constants. RTX objects in this group are only in GC memory now because
one RTX object on GC-memory cannot point to a non-GC RTX object (the
mark-and-sweep process expects all objects to be in GC memory).

2. RTL from back-end (re-)initialization. Stuff in this group should
go on a permanent obstack that is only removed if the back end is
re-initialized (e.g. for the MIPS back end, or for future multi-target
support).

3. RTL per translation unit. I am not sure what falls in this class.
Things like RTL for global variables maybe? RTL that may escape from
functions? Apparently the latter happens with labels, I hope it only
happens with nested functions, really. Got some insights to share
here? ;-)

4. RTL per function. GCC expands one GIMPLE function at a time, and
the idea is to initialize the RTL obstack once when expanding starts,
let it grow until final, and blow it away after final. Unlike 20 years
ago, this obstack is never rolled back during RTL passes. This relies
on generating not too much garbage, but memory for per-function RTL
should be dwarfed by per-translation unit GIMPLE anyway.

Jeff, few people from 20 years ago are still around, so perhaps you
can help a bit to help make things are going in the right direction.
;-)

Ciao!
Steven


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