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


On Mon, Jun 18, 2001 at 11:29:12AM -0400, DJ Delorie wrote:
> 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.

No.

> Otherwise, we'd need to keep track of such pseudos on a per-function
> basis, and have inline integration stitch them together.

This is a reasonable hook to have.  You (should) already track the
pseudos in struct machine_function, all you need is a hook to do
something like

integrate.c:
#ifdef MACH_DEP_REG_MAP
  MACH_DEP_REG_MAP (map, cfun, inl_f);
#endif

somemachine.h:
#define MACH_DEP_REG_MAP(MAP, TO, FROM)					\
  if ((FROM)->machine->gp)						\
    {									\
      if (!(TO)->machine->gp)						\
	create_a_gp();							\
      (MAP)->reg_map[REGNO ((FROM)->machine->gp)] = (TO)->machine->gp;	\
    }
  

Of course, the _real_ solution is to convert all of the front ends
so that we can get rid of the rtl inliner....


r~


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