Commit 179b8d05 by Mikhail Maltsev Committed by Jeff Law

[PATCH 1/9] ENABLE_CHECKING refactoring

[PATCH 1/9] ENABLE_CHECKING refactoring
gcc/ChangeLog:

2015-10-05  Mikhail Maltsev  <maltsevm@gmail.com>

	* common.opt: Add flag_checking.
	* system.h (CHECKING_P): Define.

libcpp/ChangeLog:

2015-10-05  Mikhail Maltsev  <maltsevm@gmail.com>

	* system.h (CHECKING_P, gcc_checking_assert): Define.

From-SVN: r228787
parent 141aa58b
2015-10-13 Mikhail Maltsev <maltsevm@gmail.com>
* common.opt: Add flag_checking.
* system.h (CHECKING_P): Define.
2015-10-13 Jakub Jelinek <jakub@redhat.com> 2015-10-13 Jakub Jelinek <jakub@redhat.com>
Aldy Hernandez <aldyh@redhat.com> Aldy Hernandez <aldyh@redhat.com>
Ilya Verbin <ilya.verbin@intel.com> Ilya Verbin <ilya.verbin@intel.com>
...@@ -46,6 +46,11 @@ int optimize_fast ...@@ -46,6 +46,11 @@ int optimize_fast
Variable Variable
bool in_lto_p = false 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. ; 0 means straightforward implementation of complex divide acceptable.
; 1 means wide ranges of inputs must work for complex divide. ; 1 means wide ranges of inputs must work for complex divide.
; 2 means C99-like requirements for complex multiply and divide. ; 2 means C99-like requirements for complex multiply and divide.
......
...@@ -716,8 +716,11 @@ extern void fancy_abort (const char *, int, const char *) ATTRIBUTE_NORETURN; ...@@ -716,8 +716,11 @@ extern void fancy_abort (const char *, int, const char *) ATTRIBUTE_NORETURN;
#ifdef ENABLE_CHECKING #ifdef ENABLE_CHECKING
#define gcc_checking_assert(EXPR) gcc_assert (EXPR) #define gcc_checking_assert(EXPR) gcc_assert (EXPR)
#define CHECKING_P 1
#else #else
/* N.B.: in release build EXPR is not evaluated. */
#define gcc_checking_assert(EXPR) ((void)(0 && (EXPR))) #define gcc_checking_assert(EXPR) ((void)(0 && (EXPR)))
#define CHECKING_P 1
#endif #endif
/* Use gcc_unreachable() to mark unreachable locations (like an /* Use gcc_unreachable() to mark unreachable locations (like an
......
2015-10-13 Mikhail Maltsev <maltsevm@gmail.com>
* system.h (CHECKING_P, gcc_checking_assert): Define.
2015-09-21 Manuel López-Ibáñez <manu@gcc.gnu.org> 2015-09-21 Manuel López-Ibáñez <manu@gcc.gnu.org>
PR c/66415 PR c/66415
......
...@@ -391,6 +391,15 @@ extern void abort (void); ...@@ -391,6 +391,15 @@ extern void abort (void);
#define __builtin_expect(a, b) (a) #define __builtin_expect(a, b) (a)
#endif #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 /* Provide a fake boolean type. We make no attempt to use the
C99 _Bool, as it may not be available in the bootstrap compiler, C99 _Bool, as it may not be available in the bootstrap compiler,
and even if it is, it is liable to be buggy. and even if it is, it is liable to be buggy.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment