> Now that I understand fully what we're trying to accomplish with the
> DT_OP_GNU_entry_value and DT_OP_GNU_call_site_parameter extensions, it
> does in fact seem like we will need to do leaf register remapping in
> var-tracking.c
> 
> Here below is a patch I'm playing with.  It's a rough draft but it
> definitely fixes the pr54200.c problem completely.

Thanks for tackling this.  I cannot really comment on the patch itself (Jakub 
is the resident expert here), only on its idea.  I think that the most correct 
approach would indeed be to also do leaf register remapping in var-tracking.c,
before analyzing the RTL stream, so that everything is correctly exposed.  In 
practice, that might be a little heavy-handed though, so...

> Another way to do this would be to not translate the incoming
> parameter registers (leave them at %i*) if we don't see the window
> save.  That way we only have to play the regno remapping game for
> these specific incoming argument pieces, rather than for everything we
> look at in the RTL stream.

...yes, probably much lighter.  I think testing crtl->uses_only_leaf_regs is 
sufficient here (and while you're at it, you could also test the value of 
HAVE_window_save, which can be 0 if -mflat is passed on the SPARC), so

#ifdef HAVE_window_save
    if (HAVE_window_save && !crtl->uses_only_leaf_regs)
      {

      }
#endif

-- 
Eric Botcazou

Reply via email to