[llvm-commits] [llvm] r165989 - in /llvm/trunk: lib/Target/X86/X86ISelDAGToDAG.cpp lib/Target/X86/X86ISelLowering.cpp lib/Target/X86/X86ISelLowering.h lib/Target/X86/X86InstrCompiler.td lib/Target/X86/X86InstrInfo.td lib/Target/X86/X86RegisterInf

Michael Liao michael.liao at intel.com
Tue Oct 16 13:58:12 PDT 2012


On Tue, 2012-10-16 at 13:46 -0700, Eli Friedman wrote:
> On Mon, Oct 15, 2012 at 3:39 PM, Michael Liao <michael.liao at intel.com> wrote:
> > Author: hliao
> > Date: Mon Oct 15 17:39:43 2012
> > New Revision: 165989
> >
> > URL: http://llvm.org/viewvc/llvm-project?rev=165989&view=rev
> > Log:
> > Add __builtin_setjmp/_longjmp supprt in X86 backend
> >
> > - Besides used in SjLj exception handling, __builtin_setjmp/__longjmp is also
> >   used as a light-weight replacement of setjmp/longjmp which are used to
> >   implementation continuation, user-level threading, and etc. The support added
> >   in this patch ONLY addresses this usage and is NOT intended to support SjLj
> >   exception handling as zero-cost DWARF exception handling is used by default
> >   in X86.
> 
> The implementation of __builtin_setjmp causes a link error on x86-64
> OSX.  Specifically, you can't take the address of a label in the way
> you're doing it (generating an instruction like "movq	$LBB1_12,
> 8(%rsi)"); the right way to take the address of a label is using
> RIP-relative addressing.

It depends on the relocation mode used. For small static code model,
'movq' is good enough without adding register pressure. I will fix it
for other models. Thanks for pointing this out.

Yours
- Michael

> 
> -Eli





More information about the llvm-commits mailing list