search for: noreturn

Displaying 20 results from an estimated 597 matches for "noreturn".

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) <<<<<<<<<<<<&lt...
2016 Mar 28
2
Ignoring coverage for noreturn decls
Hi all, Recently I’ve noticed in coverage profiles that llvm_unreachable and the like are considered uncovered because there’s no special behavior in instrumentation to ‘ignore’ noreturn paths. While I don’t necessarily think it’s ideal to ignore all noreturn decls, I think there’s definitely room for some heuristics around ignoring things like llvm_unreachable (perhaps opt-in?). I’m investigating emitting a zero region for all noreturn decls whilst codegenning, as a start. Anyon...
2012 Nov 29
0
[LLVMdev] noreturn attribute on a call instruction vs noreturn on afunction
...use CallInst::hasFnAttr(). It checks for attributes in the instruction and in the function decl. http://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) &g...
2016 May 12
3
Why LR is saved before calling a 'noreturn' function ?
Dear all, I don't get how llvm handles functions with __attribute__((noreturn)). It seems that LR register is backed up on the stack whilst it will never be used to return from a 'noreturn' function. I have this problem with a home-made backend but it seems that ARM flavour of clang has same behaviour. By the way, SP is also saved, I don't understand why. Is the...
2016 Mar 29
0
Ignoring coverage for noreturn decls
...On Mar 28, 2016, at 1:23 PM, Harlan Haskins via llvm-dev <llvm-dev at lists.llvm.org> wrote: > > Hi all, > > Recently I’ve noticed in coverage profiles that llvm_unreachable and the like are considered uncovered because there’s no special behavior in instrumentation to ‘ignore’ noreturn paths. FWIW, Daniel Dunbar and a few others have brought up the lack of a flexible "suppress coverage" mechanism as a pain-point. There are two separate but related solutions: - We should automatically emit zero mappings for code regions dominated by a call to a noreturn function....
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*...
2006 Nov 21
1
rsync v2.6.9: small patch fixing NORETURN failures
Hello, as of gcc v2.7.2.1, the noreturn attribute needs to be given *after* the prototype declaration and not before, but for gcc v3.x, things changed for this attribute again, since gcc v2.5.x did it the way, newer gcc versions prefer it... I've applied a small unified diff, fixing this stuff. THX for listening. CU Tom. (Thomas M...
2017 Nov 04
2
returns_twice / noreturn
Hello, I am not sure about the semantic (if any) of returns_twice and noreturn attributes. int fork() __attribute__((returns_twice)); void join(int) __attribute__((noreturn)); int f(int n) { int t = fork(); n++; if (t != 0) join(t); return n; } Produces the following LLVM IR: ; Function Attrs: nounwind uwtable define i32 @f(i32 %n) local_unnamed_addr #0 { entr...
2017 Nov 04
2
returns_twice / noreturn
On Fri, Nov 3, 2017 at 5:39 PM, Hal Finkel <hfinkel at anl.gov> wrote: > > On 11/03/2017 07:20 PM, Alexandre Isoard via llvm-dev wrote: > > Hello, > > I am not sure about the semantic (if any) of returns_twice and noreturn > attributes. > > int fork() __attribute__((returns_twice)); > void join(int) __attribute__((noreturn)); > > int f(int n) { > int t = fork(); > n++; > if (t != 0) > join(t); > return n; > } > > Where the n++ has been moved after the if, is that...
2011 Sep 17
1
[LLVMdev] Jumping to a fixed address in Clang
I am compiling some code with Clang which needs to jump to a fixed address to perform a "syscall". These fixed addresses contain valid code. I noticed that this code produces a warning: typedef void (*exit_syscall_type) (int status) __attribute__((noreturn)); void _exit(int status) __attribute__ ((noreturn)); void _exit(int status) { ((exit_syscall_type)0x10000)(status); } This (seemingly equivalent) code does not: typedef void (*exit_syscall_type) (int status) __attribute__((noreturn)); void _exit(int status) __attribute__ ((noreturn)); void _ex...
2007 Jan 05
0
[IA64]: noreturn cannot be used if function may return
Hi Keir: I spotted some bogus uses of the noreturn keyword on ia64. [IA64]: noreturn cannot be used if function may return The functions die_if_kernel and vmx_die_if_kernel can certainly return. This disqualifies them from using the noreturn keyword which is reserved for functions that never return. Signed-off-by: Herbert Xu <herbert@gondor....
2011 Aug 19
2
[LLVMdev] How to halt a program
...s: define i32 @main() nounwind { entry: %retval = alloca i32 ; <i32*> [#uses=1] %0 = alloca i32 ; <i32*> [#uses=0] %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0] call void @exit(i32 1) noreturn nounwind unreachable return: ; No predecessors! %retval1 = load i32* %retval ; <i32> [#uses=1] ret i32 %retval1 } So, what is the LLVM code to insert the call "call void @exit(i32 1) noreturn nounwind"? I thought ab...
2017 Feb 14
0
[PATCH v2 1/2] GCC 7: Add __attribute__((noreturn)) to some usage functions which call exit.
...5 deletions(-) diff --git a/builder/index-validate.c b/builder/index-validate.c index d3912f3..33086b2 100644 --- a/builder/index-validate.c +++ b/builder/index-validate.c @@ -38,7 +38,7 @@ extern int do_parse (struct parse_context *context, FILE *in); -static void +static void __attribute__((noreturn)) usage (int exit_status) { printf ("%s index\n", getprogname ()); diff --git a/utils/boot-analysis/boot-analysis.c b/utils/boot-analysis/boot-analysis.c index 04b3bdd..1bec9a5 100644 --- a/utils/boot-analysis/boot-analysis.c +++ b/utils/boot-analysis/boot-analysis.c @@ -88,7 +88,7 @...
2012 May 22
4
[LLVMdev] How to get llvm bitcode executed
...xx_personality_v0(...) declare i32 @llvm.eh.selector(i8*, i8*, ...) nounwind declare void @llvm.eh.resume(i8*, i32) declare void @_ZSt9terminatev() declare i32 @memcmp(i8*, i8*, i64) declare i64 @llvm.expect.i64(i64, i64) nounwind readnone declare void @_ZSt19__throw_logic_errorPKc(i8*) noreturn declare i8* @__cxa_begin_catch(i8*) declare void @__cxa_rethrow() declare void @__cxa_end_catch() declare void @__cxa_call_unexpected(i8*) declare void @_ZdlPv(i8*) nounwind declare void @_ZSt20__throw_length_errorPKc(i8*) noreturn declare void @_ZSt17__throw_bad_allocv() noreturn d...
2013 Aug 01
2
[LLVMdev] can i avoid saving CSRs for functions with noreturn
...m making a llvm compiler for shader-like programs. as we known, shader programs are short and have less function calls. i found that i have to save/restore callee-saved register(CSR) in prolog and epilog. because I can violate ABI from driver(c code) and shader, i plan to append the attribute 'noreturn' to all shader functions. in PrologEpilogInserter.cpp, you can find that it actually honor an attribute 'naked' which avoid saving CSR. however, it also skips generating stack-pointer adjustment, which i need. my patch is as follows. i am targeting RISC processor. can anyone tell me th...
2019 Aug 02
2
[RFC] Stack overflow and optimizations
...estion whether we can optimize based on the assumption that stack overflow is undefined behavior. While I think it is according to the C++ standard, Windows Structured Exception Handling and signal handlers might allow programs to recover/exit gracefully. Concretely, the patch D59978 wants add the noreturn attribute to functions that recurse infinitly. Also, a function that unconditionally calls a function with a noreturn attribute can be deduced to be noreturn. Consider the following program: ``` #include <cstdlib> #include <cstdio> void overflow(); // Secret function that triggers a s...
2009 Sep 21
1
[LLVMdev] disable insertion of unreachables
> If there's sensible control flow after a function returns, don't mark > it or calls to it noreturn. How do I prevent llvm-gcc from labelling a particular function with the noreturn attribute so an unreachable is not inserted after a call to it? Does llvm-gcc keep a list of functions somewhere that it thinks do not return? Max On Tue, Sep 8, 2009 at 10:30 PM, Eli Friedman <eli.friedman at g...
2010 Jul 15
2
[LLVMdev] Why clang++ doesn't set 'noreturn' flag on declarations of __cxa_throw and _Unwind_Resume_or_Rethrow ?
When I compile some code with the near-trunk clang++ I get this: ... tail call void @_Unwind_Resume_or_Rethrow(i8* %exn2) noreturn unreachable ... declare void @_Unwind_Resume_or_Rethrow(i8*) ... Same with __cxa_throw. 'noreturn' is missing on declarations. This seems to be a bug. Also can _Unwind_Resume_or_Rethrow actually return? When I run some simple exception code in JIT I see that this function actually ret...
2011 Aug 19
0
[LLVMdev] How to halt a program
...nd { > entry: > %retval = alloca i32 ; <i32*> [#uses=1] > %0 = alloca i32 ; <i32*> [#uses=0] > %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0] > call void @exit(i32 1) noreturn nounwind > unreachable > return: ; No predecessors! > %retval1 = load i32* %retval ; <i32> [#uses=1] > ret i32 %retval1 > } > > So, what is the LLVM code to insert the call "call void @exit(i32 1)...
2013 Feb 21
0
[LLVMdev] [llvm] r175553 - Fix a bug in mayHaveSideEffects. Functions that do not return are now considered as instructions with side effects.
Hi Nadav, > I almost missed your email because you replied only to the list. I understand your argument. I think that my fix addresses a part of it. It says that instructions that do not return should not be removed. > The current implementation of mayReturn is to check the 'noreturn' function attribute. Are you suggesting to add a new attribute that is called 'mustreturn' ? It is as equally difficult to know if a function will halt. a function would only be 'mustreturn' [*] if you can prove that it must return in finite time. By default functions would no...