On Mon, Jan 05, 2015 at 07:19:33AM -0700, Jeff Law wrote:
> On 01/04/15 10:16, Richard Biener wrote:
> >>>
> >>>But either your new hook or the original fix makes no sense.
> >>
> >>All I want is to restore the old behavior on x86.  If the original fix
> >>makes no sense, should it be reverted?
> >
> >I think the original fix is too conservative
> Perhaps.  Neither John nor I felt it was too conservative.  But disagreeing
> slightly on this isn't a big deal.
> 
> >But I also think there is a target independent bug, thus a target hook to 
> >"fix" things for x86 makes no sense.
> Agreed 100%.

So isn't the right replacement for the target hook H.J. wanted to add
the HARD_FRAME_POINTER_IS_ARG_POINTER macro?
If argp is not hfp, then the stores through argp are not considered
to be based on the frame pointer, if it is the same thing, such as on PA,
then indeed sibcall stack argument stores are frame related.
You could also add a !reload_completed to that, after RA frame_read is
how this is handled.

      /* Arguments for a sibling call that are pushed to memory are passed
         using the incoming argument pointer of the current function.  If
         argument pointer is the hard frame pointer, then treat sibling
         calls as wild reads before reload; after reload frame_read flag
         should take care of this.  */
      if (HARD_FRAME_POINTER_IS_ARG_POINTER
          && SIBLING_CALL_P (insn)
          && !reload_completed)
        {
          add_wild_read (bb_info);
          return;
        }

?

        Jakub

Reply via email to