[Qemu-devel] [PULL 36/54] tcg/tcg.h: Remove GCC check for tcg_debug_assert() macro

Paolo Bonzini posted 54 patches 6 years, 10 months ago
[Qemu-devel] [PULL 36/54] tcg/tcg.h: Remove GCC check for tcg_debug_assert() macro
Posted by Paolo Bonzini 6 years, 10 months ago
From: Thomas Huth <thuth@redhat.com>

Both GCC v4.8 and Clang v3.4 support (our minimum versions) support
__builtin_unreachable(), so we can remove the version check here now.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-Id: <1543937577-28256-5-git-send-email-thuth@redhat.com>
---
 tcg/tcg.h | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/tcg/tcg.h b/tcg/tcg.h
index cbe4309..973a757 100644
--- a/tcg/tcg.h
+++ b/tcg/tcg.h
@@ -230,11 +230,9 @@ typedef uint64_t tcg_insn_unit;
 
 #if defined CONFIG_DEBUG_TCG || defined QEMU_STATIC_ANALYSIS
 # define tcg_debug_assert(X) do { assert(X); } while (0)
-#elif QEMU_GNUC_PREREQ(4, 5)
+#else
 # define tcg_debug_assert(X) \
     do { if (!(X)) { __builtin_unreachable(); } } while (0)
-#else
-# define tcg_debug_assert(X) do { (void)(X); } while (0)
 #endif
 
 typedef struct TCGRelocation {
-- 
1.8.3.1