Skip to content

Commit

Permalink
Mark __assert_fail as _Noreturn.
Browse files Browse the repository at this point in the history
This eliminates a performance regression caused in the box2d
benchmark by switching to the musl headers.  Without this
being _Noreturn, clang / llvm generates much worse code involving
phis and extra loads.
  • Loading branch information
waywardmonkeys committed Sep 24, 2013
1 parent 4db5a7e commit baa4d38
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion system/include/libc/assert.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
extern "C" {
#endif

void __assert_fail (const char *, const char *, int, const char *);
_Noreturn void __assert_fail (const char *, const char *, int, const char *);

#ifdef __cplusplus
}
Expand Down
1 change: 1 addition & 0 deletions system/lib/libc/musl/readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ Differences from upstream musl include:
* various 64 bit types are 32 bit instead including off_t,
ino_t, dev_t, blkcnt_t, fsblkcnt_t, fsfilcnt_t, rlim_t.
* We don't define _POSIX_SHARED_MEMORY_OBJECTS.
* We flag __assert_fail as _Noreturn.

0 comments on commit baa4d38

Please sign in to comment.