[PATCH] PR8541; X86: Handle unwind.init and eh.return intrinsics.

Jakob Stoklund Olesen stoklund at 2pi.dk
Tue May 14 16:26:49 PDT 2013


On May 14, 2013, at 3:14 PM, Pasi Parviainen <pasi.parviainen at iki.fi> wrote:

> On 14.5.2013 21:06, Jakob Stoklund Olesen wrote:
>> 
>> On Apr 20, 2013, at 1:43 AM, Pasi Parviainen <pasi.parviainen at iki.fi> wrote:
>> 
>>> Hi,
>>> 
>>> First patch addresses the problem in PR8541. It forces spilling of affected registers to stack when unwind.init and eh.return intrinsics are encountered.
>>> 
>>> Second patch is additional patch which relaxes the requirement of frame pointer in functions with eh.return.
>>> 
>>> Pasi
>> 
>> Hi Pasi,
>> 
>> It looks like you actually know what eh.return is supposed to do. Could you explain, please?
> 
> It is a terminator intrinsic which purpose is to return control flow from a unwinder (libgcc_s) back to a landingpad. For this it needs to provide exception information through registers for the landingpad. These registers must be spilled to stack slots in a prologue and restored only in epilogues containing eh.return intrinsic.

Thanks.

Is it important that the extra registers are not restored in non-eh.return epilogues? If not, a simpler implementation would simply spill all callee-saved registers in eh.return functions. This is essentially the workaround FreeBSD is using now by inserting inline assembly.

When all the epilogues are identical, they are tail-merged, so the generated code should be a bit smaller.


/jakob




More information about the llvm-commits mailing list