https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67856

--- Comment #5 from Segher Boessenkool <segher at gcc dot gnu.org> ---
The prologue does a lot of separate things:
- Save non-volatile registers;
- Do whatever needs to be done to be able to call things (save the
return address, align the stack, whatever; different per target);
- Set up a stack frame;
- Do whatever needs to be done for the static chain;
- Set up registers for PIC;
- Etc.

Not all of those can be separated for every target.  There also is
a required ordering between them, different per target as well.
Doing multiple of those together may be cheaper as well (say, pushing
registers to set up the stack frame or aligned stack).

GCC does not yet have any way to ask the backend to split the prologue
into such separate pieces.  It isn't clear to me what a good interface
would be.

Relatedly, there are cases where it would be useful to insert (pieces
of) the prologue at multiple points, not at a common dominator of all
that need it.  For example, a function that requires no prologue at
all except for no-return error paths (that need the backchain saved
for backtracing to work).  What would be good heuristics for that is
unclear as well.

Reply via email to