This is the mail archive of the gcc@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]

Re: regno_reg_rtx and related macros


Bernd Schmidt <bernds@balti.cygnus.co.uk> writes:

> > I think we should rather have a function that is used for every switch,
> > I.e. copy the separate global variables into current_function->emit,
> > change current_function, copy current_function->emit into the separate
> > global variables, and zero out any pointers in current_funtion->emit that
> > we copied out (to avoid garbage collection following stale roots).
> > 
> > To make garbage collection work, every pointer that is made into a global
> > variable again has also to be registered as a gc root.
> 
> Sounds exactly like the mess we used to have.  IMO small inconveniences in
> debugging don't outweigh the benefit of having much simpler code in the
> compiler.

Perhaps we could have both; for instance, if we have a macro

#define FOO(a,b,c) some_huge_computation + a + b + c

then, in a separate source file, do

int (FOO) (int a, int b, int c) { return FOO(a,b,c); }

this way you can write

print FOO(aa,bb,cc)

in the debugger.

This would be particularly useful for all those RTX accessor macros so
you don't have to remember which rtunion field you should be looking
at, and can copy-and-paste from source files into the debugger.

-- 
- Geoffrey Keating <geoffk@cygnus.com>


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