search for: __builtin_longjmp

Displaying 20 results from an estimated 21 matches for "__builtin_longjmp".

2013 May 22
1
[LLVMdev] x86 frame pointer and __builtin_setjmp/__builtin_longjmp
...char *argv[]) { void *buf[20]; __attribute__((__aligned__(64))) char q; // realign the stack char *p = __builtin_alloca(argc); // dynamic alloca if (__builtin_setjmp(buf)) { *p = 'p'; q = 'q'; return 0; } asm("movq $0, %rbx"); __builtin_longjmp(buf, 1); } LLVM is choosing to use rbx as a base pointer to access p and q, but during builtin_setjmp, rbx is not saved; when the longjmp is executed rbx may have a garbage value. GCC on the other hand, is using rbp, which is saved in the jump buffer. Is this a bug in LLVM, or am I using __buil...
2015 Feb 10
2
[LLVMdev] Semantics of __builtin_setjmp/__builtin_longjmp
Hi all, currently we lower the __builtin_setjmp/__builtin_longjmp intrinsincs to SjLj exception style intrinsics. For ARM on non-Darwin, they end up as nops, breaking Ruby. This leads to the question of what the defined semantics of them is. (a) Are they supposed to be compatible with libc? PPC disagrees in comments. (b) Are they supposed to be compatible with...
2011 Apr 12
2
[LLVMdev] built-in longjmp and setjmp
Does the X86 backend (or any other backend) correctly implement support for __builtin_setjmp and __builtin_longjmp? I don't get the correct result when I compile and run the following code with clang. # clang foo.c -O3; ./a.out #include <stdio.h> void *buf[20]; void __attribute__((noinline)) foo (void) { __builtin_longjmp (buf, 1); } int main (int argc, char** argv) { if (__builtin_setjmp (buf)...
2011 Apr 12
0
[LLVMdev] built-in longjmp and setjmp
...andling. Calling them directly like this is very much not recommended. Using the system library setjmp()/longjmp() functions is preferred. -Jim On Apr 12, 2011, at 1:56 PM, Akira Hatanaka wrote: > Does the X86 backend (or any other backend) correctly implement support for __builtin_setjmp and __builtin_longjmp? > I don't get the correct result when I compile and run the following code with clang. > > # clang foo.c -O3; ./a.out > > #include <stdio.h> > void *buf[20]; > void __attribute__((noinline)) > foo (void) > { > __builtin_longjmp (buf, 1); > } > &gt...
2012 Nov 28
4
[LLVMdev] noreturn attribute on a call instruction vs noreturn on a function
Hi, Building the following C code I get a call instruction that has no noreturn attribute, while the function itself does have it. void foo(void **b) { __builtin_longjmp(b, 1); } define void @_Z3fooPPv(i8** %b) noreturn nounwind uwtable { entry: %0 = bitcast i8** %b to i8* tail call void @llvm.eh.sjlj.longjmp(i8* %0) <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<...
2011 Apr 12
2
[LLVMdev] built-in longjmp and setjmp
...his is very much not recommended. > Using the system library setjmp()/longjmp() functions is preferred. > > -Jim > > On Apr 12, 2011, at 1:56 PM, Akira Hatanaka wrote: > > > Does the X86 backend (or any other backend) correctly implement support > for __builtin_setjmp and __builtin_longjmp? > > I don't get the correct result when I compile and run the following code > with clang. > > > > # clang foo.c -O3; ./a.out > > > > #include <stdio.h> > > void *buf[20]; > > void __attribute__((noinline)) > > foo (void) > > { &gt...
2012 Nov 29
0
[LLVMdev] noreturn attribute on a call instruction vs noreturn on afunction
...ttp://llvm.org/docs/doxygen/html/Instructions_8cpp_source.html#l00345 Nuno ----- Original Message ----- > Hi, > > Building the following C code I get a call instruction that has no > noreturn > attribute, while the function itself does have it. > > void foo(void **b) { > __builtin_longjmp(b, 1); > } > > > define void @_Z3fooPPv(i8** %b) noreturn nounwind uwtable { > entry: > %0 = bitcast i8** %b to i8* > tail call void @llvm.eh.sjlj.longjmp(i8* %0) > <<<<<<<<<<<<<<<<<<<<<<<<<<<...
2012 Nov 28
0
[LLVMdev] noreturn attribute on a call instruction vs noreturn on a function
Hi Kostya, On 28/11/12 14:47, Kostya Serebryany wrote: > Hi, > > Building the following C code I get a call instruction that has no noreturn > attribute, while the function itself does have it. > > void foo(void **b) { > __builtin_longjmp(b, 1); > } > > > define void @_Z3fooPPv(i8** %b) noreturn nounwind uwtable { > entry: > %0 = bitcast i8** %b to i8* > tail call void @llvm.eh.sjlj.longjmp(i8* %0) > <<<<<<<<<<<<<<<<<<<<<<<<<<...
2011 Apr 12
0
[LLVMdev] built-in longjmp and setjmp
...like this is very much not recommended. Using the system library setjmp()/longjmp() functions is preferred. > > -Jim > > On Apr 12, 2011, at 1:56 PM, Akira Hatanaka wrote: > > > Does the X86 backend (or any other backend) correctly implement support for __builtin_setjmp and __builtin_longjmp? > > I don't get the correct result when I compile and run the following code with clang. > > > > # clang foo.c -O3; ./a.out > > > > #include <stdio.h> > > void *buf[20]; > > void __attribute__((noinline)) > > foo (void) > > { > &gt...
2011 Apr 27
2
[LLVMdev] built-in longjmp and setjmp
...-O3 -S -ccc-host-triple > arm-unknown-darwin -ccc-clang-archs arm > $ llc setjmp6.arm.ll -o setjmp6.arm.s > > > #include <stdio.h> > #include <stdlib.h> > void *buf[20]; > > int gi2 = 0; > > > void __attribute__ ((noinline)) sub2 (void) > { > __builtin_longjmp (buf, 1); > > } > > int > main (int argc, char **argv) > { > int n = atoi (argv[1]); > int r = __builtin_setjmp (buf); > ++gi2; > > if (r) > { > printf ("setjmp %d\n", n + gi2); > return 0; > } > > sub2 (); &...
2011 Apr 27
1
[LLVMdev] built-in longjmp and setjmp
...t; > > > > > > > #include <stdio.h> > > > #include <stdlib.h> > > > void *buf[20]; > > > > > > int gi2 = 0; > > > > > > > > > void __attribute__ ((noinline)) sub2 (void) > > > { > > > __builtin_longjmp (buf, 1); > > > > > > } > > > > > > int > > > main (int argc, char **argv) > > > { > > > int n = atoi (argv[1]); > > > int r = __builtin_setjmp (buf); > > > ++gi2; > > > > > > if (r) > >...
2013 May 08
1
[LLVMdev] Clarifying the state of setjmp/longjmp support in LLVM and Clang
.... Clang recognizes two forms of setjmp (all I say here applies to longjmp similarly): * __builtin_setjmp: gets lowered to calling the llvm.sjlj.setjmp intrinsic * setjmp() library call does not appear to be handled specially, although a no-longer-comment in a test I removed in r181468 said: "__builtin_longjmp/setjmp should get transformed into llvm.setjmp/longjmp > just like explicit setjmp/longjmp calls are." On my Ubuntu machine, the call actually gets transcibed to calling _setjmp, but that may be due to compiler settings in system library headers. LLVM. LLVM supports two flavors of setj...
2011 Apr 27
0
[LLVMdev] built-in longjmp and setjmp
...of attached file). $ clang setjmp6.c -o setjmp6.arm.ll -emit-llvm -O3 -S -ccc-host-triple arm-unknown-darwin -ccc-clang-archs arm $ llc setjmp6.arm.ll -o setjmp6.arm.s #include <stdio.h> #include <stdlib.h> void *buf[20]; int gi2 = 0; void __attribute__ ((noinline)) sub2 (void) { __builtin_longjmp (buf, 1); } int main (int argc, char **argv) { int n = atoi (argv[1]); int r = __builtin_setjmp (buf); ++gi2; if (r) { printf ("setjmp %d\n", n + gi2); return 0; } sub2 (); return 0; } On Wed, Apr 13, 2011 at 10:05 AM, Jakob Stoklund Olesen <stoklu...
2011 Apr 13
3
[LLVMdev] built-in longjmp and setjmp
On Apr 13, 2011, at 9:51 AM, Akira Hatanaka wrote: > int > main (int argc, char** argv) > { > int n = atoi(argv[1]), r; > > if ((r = setjmp (buf))) > { > printf("n = %d\n", n); > return 0; > } Non-volatile local variables are not preserved by setjmp(), so this program can print whatever it wants. /jakob
2011 Apr 27
3
[LLVMdev] built-in longjmp and setjmp
...arm > > $ llc setjmp6.arm.ll -o setjmp6.arm.s > > > > > > #include <stdio.h> > > #include <stdlib.h> > > void *buf[20]; > > > > int gi2 = 0; > > > > > > void __attribute__ ((noinline)) sub2 (void) > > { > > __builtin_longjmp (buf, 1); > > > > } > > > > int > > main (int argc, char **argv) > > { > > int n = atoi (argv[1]); > > int r = __builtin_setjmp (buf); > > ++gi2; > > > > if (r) > > { > > printf ("setjmp %d\n",...
2011 Apr 27
0
[LLVMdev] built-in longjmp and setjmp
...-O3 -S -ccc-host-triple arm-unknown-darwin -ccc-clang-archs arm > $ llc setjmp6.arm.ll -o setjmp6.arm.s > > > #include <stdio.h> > #include <stdlib.h> > void *buf[20]; > > int gi2 = 0; > > > void __attribute__ ((noinline)) sub2 (void) > { > __builtin_longjmp (buf, 1); > > } > > int > main (int argc, char **argv) > { > int n = atoi (argv[1]); > int r = __builtin_setjmp (buf); > ++gi2; > > if (r) > { > printf ("setjmp %d\n", n + gi2); > return 0; > } > > sub2 (...
2016 Apr 15
3
[Sparc] Load address with SETHI
Hi, I'm trying to implement __builtin_setjmp / __builtin_longjmp for Sparc processors. I think I'm very close, but I can't work out how to issue BuildMI-type instructions to load the address of the recovery location (set in setjmp) into a register using the SETHI / OR combination. I can't see any equivalent code anywhere else in Sparc. I imagine thi...
2011 Apr 27
0
[LLVMdev] built-in longjmp and setjmp
...arm > > $ llc setjmp6.arm.ll -o setjmp6.arm.s > > > > > > #include <stdio.h> > > #include <stdlib.h> > > void *buf[20]; > > > > int gi2 = 0; > > > > > > void __attribute__ ((noinline)) sub2 (void) > > { > > __builtin_longjmp (buf, 1); > > > > } > > > > int > > main (int argc, char **argv) > > { > > int n = atoi (argv[1]); > > int r = __builtin_setjmp (buf); > > ++gi2; > > > > if (r) > > { > > printf ("setjmp %d\n",...
2014 Oct 09
4
[LLVMdev] Remaining Compiler-RT failures in ARM
Folks, As of this run: http://lab.llvm.org:8011/builders/clang-cmake-armv7-a15-full/builds/746 There are three classes of failures that need fixing before we get the bot green: 1. AddressSanitizer.BuiltinLongJmpTest Unit Test Two configurations fail: * Asan-arm-inline-Test * Asan-arm-with-calls-Test I wonder what's the best way to run it individually and reduce the error. I'm not
2013 Oct 10
3
[LLVMdev] A new builtin: __builtin_stack_pointer()
...r, "v*v*", "n") BUILTIN(__builtin_frame_address, "v*IUi", "n") +BUILTIN(__builtin_stack_pointer, "v*", "n") BUILTIN(__builtin_flt_rounds, "i", "nc") BUILTIN(__builtin_setjmp, "iv**", "j") BUILTIN(__builtin_longjmp, "vv**i", "r") diff --git a/lib/CodeGen/CGBuiltin.cpp b/lib/CodeGen/CGBuiltin.cpp index d187678..f66f506 100644 --- a/lib/CodeGen/CGBuiltin.cpp +++ b/lib/CodeGen/CGBuiltin.cpp @@ -736,6 +736,11 @@ RValue CodeGenFunction::EmitBuiltinExpr(const FunctionDecl *FD, Value *F = CG...