From baa4d38f13f436bdeba724f0825bbe985637be22 Mon Sep 17 00:00:00 2001 From: Bruce Mitchener Date: Tue, 24 Sep 2013 21:01:04 +0700 Subject: [PATCH] Mark __assert_fail as _Noreturn. 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. --- system/include/libc/assert.h | 2 +- system/lib/libc/musl/readme.txt | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/system/include/libc/assert.h b/system/include/libc/assert.h index ab745db18022a..c64d3e52db15e 100644 --- a/system/include/libc/assert.h +++ b/system/include/libc/assert.h @@ -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 } diff --git a/system/lib/libc/musl/readme.txt b/system/lib/libc/musl/readme.txt index 16c584237c538..9ca04036025a7 100644 --- a/system/lib/libc/musl/readme.txt +++ b/system/lib/libc/musl/readme.txt @@ -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.