From f19aab88d5c92e9cb9cbb9f7c9b84e39ba2e2709 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Fri, 25 Feb 2022 09:01:36 +0100 Subject: [PATCH] DEBUG: mark ABORT_NOW() as unreachable The purpose is to make the program die at this point, so let's help the compiler optimise the code (especially in sensitive areas) by telling it that ABORT_NOW() does not return. This reduces the overall code size by ~0.5%. --- include/haproxy/bug.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/haproxy/bug.h b/include/haproxy/bug.h index ddf55e805..4cedbf11f 100644 --- a/include/haproxy/bug.h +++ b/include/haproxy/bug.h @@ -47,7 +47,7 @@ /* More efficient than abort() because it does not mangle the * stack and stops at the exact location we need. */ -#define ABORT_NOW() do { DUMP_TRACE(); (*(volatile int*)1=0); } while (0) +#define ABORT_NOW() do { DUMP_TRACE(); (*(volatile int*)1=0); my_unreachable(); } while (0) #endif /* This is the generic low-level macro dealing with conditional warnings and