From 2c46a62f296a1e66c9438bba6a2c418698b831de Mon Sep 17 00:00:00 2001 From: Nathan Sidwell Date: Sat, 28 Aug 2004 14:23:07 +0000 Subject: [PATCH] system.h (gcc_assert): Remove __builtin_expect. * system.h (gcc_assert): Remove __builtin_expect. Evaluate EXPR even when not checking. From-SVN: r86692 --- gcc/ChangeLog | 5 +++++ gcc/system.h | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 74a6b13be16..6eb15ca7570 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2004-08-28 Nathan Sidwell + + * system.h (gcc_assert): Remove __builtin_expect. Evaluate EXPR + even when not checking. + 2004-08-27 Jason Merrill PR c++/13684 diff --git a/gcc/system.h b/gcc/system.h index 934a332162f..191e1b102c6 100644 --- a/gcc/system.h +++ b/gcc/system.h @@ -508,10 +508,10 @@ extern void fancy_abort (const char *, int, const char *) ATTRIBUTE_NORETURN; /* Use gcc_assert(EXPR) to test invariants. */ #if ENABLE_ASSERT_CHECKING #define gcc_assert(EXPR) \ - ((void)(__builtin_expect (!(EXPR), 0) \ - ? fancy_abort (__FILE__, __LINE__, __FUNCTION__), 0 : 0)) + ((void)(!(EXPR) ? fancy_abort (__FILE__, __LINE__, __FUNCTION__), 0 : 0)) #else -#define gcc_assert(EXPR) ((void)0) +/* Include EXPR, so that unused variable warnings do not occur. */ +#define gcc_assert(EXPR) ((void)(0 && (EXPR))) #endif /* Use gcc_unreachable() to mark unreachable locations (like an -- 2.30.2