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: PATCH: extra machine-dependent passes


  In message <200106181529.LAA24396@greed.delorie.com>you write:
  > 
  > > If we really need something like this, then let's write a pass to do it,
  > 
  > Can we do this?
  > 
  > Create a function
  > 
  > 	rtx gen_reg_initial_hard_value (int regno);
  > 
  > This function returns a pseudo that corresponds to the initial value
  > hard register `regno' had at the beginning of the function.  It will
  > coordinate any mark/sweep logic needed for GC.  Inline integration
  > will "magically happen".  A SET rtx is automatically added to
  > functions that need it, for each such pseudo.
We have this capability right now -- the PA port uses it to set up a 
pseudo holding the value of the hard PIC register.  Again, talk to
Alan and John, they'll be able to tell you how it works.

  > Question: Can you create a pseudo globally?  I.e. call gen_reg_rtx and
  > store the value in a global, to be reused for multiple functions.
  > init_emit() would need to be modified to bump reg_rtx_no.  Otherwise,
  > we'd need to keep track of such pseudos on a per-function basis, and
  > have inline integration stitch them together.
Nope, at least not easily.


  > > which is big enough to drive a mac truck through.
  > 
  > What's wrong with Mack Trucks? http://www.macktrucks.com/
Nothing wrong with Mack trucks, except that they don't belong in compilers :-)

Basically the kind of hook you're proposing is ripe for major abuse.  Just
look at what folks have done with MACHINE_DEPENDENT_REORG already.  Yours is
even worse as it infects the compiler even earlier with more machine dependent
stuff.

I'd much rather see this dealt with in the backend (which is definitely 
possible) or we provide a well defined, well behaved routine to initialize
the registers you want.  I don't want to see us add the capability for the
target to munge RTL in arbitrary ways.

Jeff


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