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: Initial values vs inlined functions [was: PATCH: extra machine-dependent passes]


On Wed, Jun 20, 2001 at 02:43:51PM -0400, DJ Delorie wrote:
> + static void
> + setup_initial_hard_reg_value_integration (inl_f, remap)
> +      struct function *inl_f;
> +      struct inline_remap *remap;
> + {
> +   struct initial_value_struct *ivs = inl_f->hard_reg_initial_vals;
> +   int i;
> + 
> +   if (ivs == 0)
> +     return;
> + 
> +   for (i = 0; i < ivs->num_entries; i ++)
> +     {
> +       rtx pseudo = copy_rtx_and_substitute (ivs->entries[i].pseudo, remap, 0);
> +       rtx parent = get_func_hard_reg_initial_val (cfun, ivs->entries[i].hard_reg);
> +       emit_move_insn (pseudo, parent);

One last thing.  There's no need for emitting a move.  Do

  remap->reg_map[REGNO (ivs->entries[i].pseudo)]
    = get_func_hard_reg_initial_val (cfun, ivs->entries[i].hard_reg);

which will make copy_rtx_and_substitute replace the pseudos
from the callee with the pseudos from the caller.

Ok with that change.


r~


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