From: Mikhail Maltsev Date: Tue, 13 Oct 2015 21:31:48 +0000 (+0000) Subject: [PATCH 1/9] ENABLE_CHECKING refactoring X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=179b8d05e9b773510208660d57f7e78504e75a9d;p=gcc.git [PATCH 1/9] ENABLE_CHECKING refactoring [PATCH 1/9] ENABLE_CHECKING refactoring gcc/ChangeLog: 2015-10-05 Mikhail Maltsev * common.opt: Add flag_checking. * system.h (CHECKING_P): Define. libcpp/ChangeLog: 2015-10-05 Mikhail Maltsev * system.h (CHECKING_P, gcc_checking_assert): Define. From-SVN: r228787 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 750c73aad08..dc9b1f3867b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2015-10-13 Mikhail Maltsev + + * common.opt: Add flag_checking. + * system.h (CHECKING_P): Define. + 2015-10-13 Jakub Jelinek Aldy Hernandez Ilya Verbin diff --git a/gcc/common.opt b/gcc/common.opt index b0f70fb4e9e..50602082173 100644 --- a/gcc/common.opt +++ b/gcc/common.opt @@ -46,6 +46,11 @@ int optimize_fast Variable bool in_lto_p = false +; Enable additional checks of internal state consistency, which may slow +; the compiler down. +Variable +bool flag_checking = CHECKING_P + ; 0 means straightforward implementation of complex divide acceptable. ; 1 means wide ranges of inputs must work for complex divide. ; 2 means C99-like requirements for complex multiply and divide. diff --git a/gcc/system.h b/gcc/system.h index f1694b94430..61790d74a72 100644 --- a/gcc/system.h +++ b/gcc/system.h @@ -716,8 +716,11 @@ extern void fancy_abort (const char *, int, const char *) ATTRIBUTE_NORETURN; #ifdef ENABLE_CHECKING #define gcc_checking_assert(EXPR) gcc_assert (EXPR) +#define CHECKING_P 1 #else +/* N.B.: in release build EXPR is not evaluated. */ #define gcc_checking_assert(EXPR) ((void)(0 && (EXPR))) +#define CHECKING_P 1 #endif /* Use gcc_unreachable() to mark unreachable locations (like an diff --git a/libcpp/ChangeLog b/libcpp/ChangeLog index 5cb23d03267..d14a26108ce 100644 --- a/libcpp/ChangeLog +++ b/libcpp/ChangeLog @@ -1,3 +1,7 @@ +2015-10-13 Mikhail Maltsev + + * system.h (CHECKING_P, gcc_checking_assert): Define. + 2015-09-21 Manuel López-Ibáñez PR c/66415 diff --git a/libcpp/system.h b/libcpp/system.h index a2e8c26b0b0..20f07bbe261 100644 --- a/libcpp/system.h +++ b/libcpp/system.h @@ -391,6 +391,15 @@ extern void abort (void); #define __builtin_expect(a, b) (a) #endif +#ifdef ENABLE_CHECKING +#define gcc_checking_assert(EXPR) gcc_assert (EXPR) +#define CHECKING_P 1 +#else +/* N.B.: in release build EXPR is not evaluated. */ +#define gcc_checking_assert(EXPR) ((void)(0 && (EXPR))) +#define CHECKING_P 1 +#endif + /* Provide a fake boolean type. We make no attempt to use the C99 _Bool, as it may not be available in the bootstrap compiler, and even if it is, it is liable to be buggy.