This is the mail archive of the gcc-patches@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]
Other format: [Raw text]

Re: [PATCH] Set stores_off_frame_dead_at_return to false if sibling call


On 12/04/14 08:50, John David Anglin wrote:
On 12/1/2014 11:57 AM, Jeff Law wrote:
Prior to reload (ie, in DSE1) there's a bit of magic in that we do
not set frame_read on call insns.  That may in fact be wrong and
possibly the source of the problem.

/* This field is only used for the processing of const functions.
These functions cannot read memory, but they can read the stack
because that is where they may get their parms.  We need to be this
conservative because, like the store motion pass, we don't consider
CALL_INSN_FUNCTION_USAGE when processing call insns. Moreover, we
need to distinguish two cases: 1. Before reload (register
elimination), the stores related to outgoing arguments are stack
pointer based and thus deemed of non-constant base in this pass.
This requires special handling but also means that the frame
pointer based stores need not be killed upon encountering a const
function call.
The above is wrong for sibcalls.  Sibcall arguments are relative to
the incoming argument pointer.  Is this always the frame pointer?
I don't think it's always the frame pointer. Don't we use an argument pointer for the PA64 runtime? If I recall, it was the only port that had a non-eliminable argument pointer at the time.



If that is the case, then it may be possible to eliminate stack based
 stores when we have a sibcall before reload.
if (reload_completed || SIBLING_CALL_P (insn))
insn_info->frame_read = true;
This works.

Dave



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