summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--includes/Rts.h7
-rw-r--r--rts/sm/CNF.c5
2 files changed, 8 insertions, 4 deletions
diff --git a/includes/Rts.h b/includes/Rts.h
index 3d4538f41d..be81b0d9c7 100644
--- a/includes/Rts.h
+++ b/includes/Rts.h
@@ -61,6 +61,13 @@ extern "C" {
#define RTS_UNLIKELY(p) p
#endif
+/* __builtin_unreachable is supported since GNU C 4.5 */
+#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)
+#define RTS_UNREACHABLE __builtin_unreachable()
+#else
+#define RTS_UNREACHABLE abort()
+#endif
+
/* Fix for mingw stat problem (done here so it's early enough) */
#ifdef mingw32_HOST_OS
#define __MSVCRT__ 1
diff --git a/rts/sm/CNF.c b/rts/sm/CNF.c
index 0594a6eb7d..f8e706aaf4 100644
--- a/rts/sm/CNF.c
+++ b/rts/sm/CNF.c
@@ -164,11 +164,8 @@ compactAllocateBlockInternal(Capability *cap,
default:
#ifdef DEBUG
ASSERT(!"code should not be reached");
-#elif __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)
- /* __builtin_unreachable is supported since GNU C 4.5 */
- __builtin_unreachable();
#else
- abort();
+ RTS_UNREACHABLE;
#endif
}
RELEASE_SM_LOCK;