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: RFA: make reg_equiv_memory_loc visible to garbage collector(Was:


On Mon, 2004-05-17 at 04:22, Joern Rennecke wrote:
> And after all, reg_equiv_memory_loc_varray is not used exclusively in
> reload, but also in other parts of the register allocator, so rtl.h
> seemed like a suitable alternate home for it.

It used to be that reg_equiv_memory_loc was only used in reload.  If you
grep for it, you can see that almost all of the uses are in reload.  The
only references outside reload are 2 in integrate.c, 3 in passes.c, and
3 in ra.c.  The ones in ra.c can be excused, that is a register
allocation pass.  The ones in integrate.c and passes.c shouldn't be
necessary.  They were added by your ALLOCATE_INITIAL_VALUE patch. 
Actually, the passes.c change was added to toplev.c and then later the
code was split out into passes.c.  So now this patch adds references to
rtl.h and toplev.c (again).

I'd prefer that we try to keep gcc modular, which means
reg_equiv_memory_loc references should remain in reload.  That was why I
was looking for ways to avoid the rtl.h and toplev.c changes.

> It seemed less intrusive to put the declaration for
> reg_equiv_memory_loc_varray into rtl.h than to include reload.h
> in the gengtype machinery.

The gengtype problem didn't occur to me at the time.  I still think it
makes sense for modularity reasons to try to keep reg_equiv_memory_loc
in reload.  I think you should try making the gengtype change.  If you
run into problems, I won't insist on it.

> from init_backend, so that should be all right for now, but is it safe
> to assume that init_reload will always be called before
> rest_of_handle_old_regalloc / reg_alloc ?
> The comment in reload.c suggests otherwise.

The comment in reload.c is old.  It is present even in gcc-1.42. 
Curiously, there is no init_reload function in gcc-1.42, even though the
comment is there.  It looks like there used to be an init_reload
function in old gcc 1.x sources, it got removed at some point, and then
a new init_reload function was added to gcc-2.0.  The new gcc-2.x
init_reload function has always been called once, along with all of the
other once-per-compile backend initialization functions.  It is safe to
put the reg_equiv_memory_loc_varray call here.
-- 
Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com


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