[PATCH] Make PrologEpilogInserter save/restore all callee saved registers in functions which call __builtin_unwind_init()

Jakob Stoklund Olesen stoklund at 2pi.dk
Thu Jun 13 18:31:57 PDT 2013


On Jun 13, 2013, at 2:09 PM, Derek Schuff <dschuff at google.com> wrote:

> Attached is a patch which makes PEI::calculateCalleeSavedRegisters save/restore all callee saved registers (even those which are not used) in functions which call __builtin_unwind_init().
> __builtin_unwind_init() is an undocumented gcc intrinsic which has this effect, and is used in libgcc_eh.
> 
> This should fix PR8541.
> 
> I say "should" because I haven't yet investigated all the relevant details of __builtin_eh_return, but it does fix some problems that we have seen which are similar to that described in the bug.
> <csr_unwind.diff>

LGTM, thanks.

We still have some issues with our handling of eh_return. The extra two registers must be restored by eh_return, but must not be restored by a normal return. We are currently restoring them unconditionally.

Search the llvm-commits archives for a patch by Pasi (CCed).

/jakob



More information about the llvm-commits mailing list