https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116028
--- Comment #21 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Andrew, any progress on bisecting the bootstrap failure?
In any case, looking at the patch:
+ if (call_save_p && latest_call_insn != NULL)
+ /* PR116028: If original_regno is a pseudo that has been assigned a
+ call-save hard register, then emit the spill insn before the call
+ insn 'latest_call_insn' instead of adjacent to 'insn'. If 'insn'
+ and 'latest_call_insn' belong to the same EBB but to two separate
+ BBs, and if 'insn' is present in the entry BB, then generating the
+ spill insn in the entry BB can prevent shrink wrap from happening.
+ This is because the spill insn references the stack pointer and
+ hence the prolog gets generated in the entry BB itself. It is
+ also more efficient to generate the spill before
+ 'latest_call_insn' as the spill now occurs only in the path
+ containing the call. */
+ lra_process_new_insns (PREV_INSN (latest_call_insn), NULL, save,
+ "Add save<-reg");
+ else
+ lra_process_new_insns (insn, before_p ? save : NULL,
+ before_p ? NULL : save,
+ call_save_p
+ ? "Add save<-reg" : "Add split<-reg");
Why
lra_process_new_insns (PREV_INSN (latest_call_insn), NULL, save, "Add
save<-reg");
as opposed to
lra_process_new_insns (latest_call_insn, save, NULL, "Add save<-reg");
?
Also, should that be done regardless of the before_p flag or should it take
that into account?
Is before latest_call_insn always the right/best spot to insert the saving?
I mean can't it in certain cases need to be inserted before some earlier call,
not the latest one?