Commit b53ef395 by Nathan Sidwell Committed by Nathan Sidwell

configure.ac (enable-checking): Add 'runtime' option.

	* configure.ac (enable-checking): Add 'runtime' option.
	* doc/install.texi (enable-checking): Document 'runtime' checking.
	* tsystem.h (gcc_assert, gcc_unreachable): Define.
	* config.in: Regenerated.
	* configure: Regenerated.

From-SVN: r96990
parent 0a2198f5
2005-03-24 Nathan Sidwell <nathan@codesourcery.com>
* configure.ac (enable-checking): Add 'runtime' option.
* doc/install.texi (enable-checking): Document 'runtime' checking.
* tsystem.h (gcc_assert, gcc_unreachable): Define.
* config.in: Regenerated.
* configure: Regenerated.
2005-03-23 Uros Bizjak <uros@kss-loka.si> 2005-03-23 Uros Bizjak <uros@kss-loka.si>
* optabs.h (enum optab_index): Remove OTI_llrint. * optabs.h (enum optab_index): Remove OTI_llrint.
......
...@@ -54,6 +54,9 @@ ...@@ -54,6 +54,9 @@
that are supported for each access macro. This is relatively cheap. */ that are supported for each access macro. This is relatively cheap. */
#undef ENABLE_RTL_FLAG_CHECKING #undef ENABLE_RTL_FLAG_CHECKING
/* Define if you want runtime assertions enabled. This is a cheap check. */
#undef ENABLE_RUNTIME_CHECKING
/* Define if you want all operations on trees (the basic data structure of the /* Define if you want all operations on trees (the basic data structure of the
front ends) to be checked for dynamic type safety at runtime. This is front ends) to be checked for dynamic type safety at runtime. This is
moderately expensive. The tree browser debugging routines will also be moderately expensive. The tree browser debugging routines will also be
......
...@@ -868,7 +868,7 @@ Optional Features: ...@@ -868,7 +868,7 @@ Optional Features:
enable expensive run-time checks. With LIST, enable expensive run-time checks. With LIST,
enable only specific categories of checks. enable only specific categories of checks.
Categories are: assert,fold,gc,gcac,misc, Categories are: assert,fold,gc,gcac,misc,
rtlflag,rtl,tree,valgrind,release,yes,all; rtlflag,rtl,runtime,tree,valgrind,release,yes,all;
--enable-mapped-location location_t is fileline integer cookie --enable-mapped-location location_t is fileline integer cookie
--enable-coverage=LEVEL --enable-coverage=LEVEL
enable compiler's code coverage collection. enable compiler's code coverage collection.
...@@ -6278,6 +6278,7 @@ ac_checking= ...@@ -6278,6 +6278,7 @@ ac_checking=
ac_tree_checking= ac_tree_checking=
ac_rtl_checking= ac_rtl_checking=
ac_rtlflag_checking= ac_rtlflag_checking=
ac_runtime_checking=1
ac_gc_checking= ac_gc_checking=
ac_gc_always_collect= ac_gc_always_collect=
ac_fold_checking= ac_fold_checking=
...@@ -6287,16 +6288,17 @@ do ...@@ -6287,16 +6288,17 @@ do
case $check in case $check in
yes) ac_assert_checking=1 ; ac_checking=1 ; yes) ac_assert_checking=1 ; ac_checking=1 ;
ac_tree_checking=1 ; ac_gc_checking=1 ; ac_tree_checking=1 ; ac_gc_checking=1 ;
ac_rtlflag_checking=1 ;; ac_rtlflag_checking=1 ; ac_runtime_checking=1 ;;
no) ac_assert_checking= ; ac_checking= ; no) ac_assert_checking= ; ac_checking= ;
ac_tree_checking= ; ac_rtl_checking= ; ac_tree_checking= ; ac_rtl_checking= ;
ac_rtlflag_checking= ; ac_gc_checking= ; ac_rtlflag_checking= ; ac_gc_checking= ;
ac_gc_always_collect= ; ac_fold_checking= ;; ac_gc_always_collect= ; ac_fold_checking= ;;
all) ac_assert_checking=1 ; ac_checking=1 ; all) ac_assert_checking=1 ; ac_checking=1 ;
ac_tree_checking=1 ; ac_rtl_checking=1 ; ac_tree_checking=1 ; ac_rtl_checking=1 ;
ac_rtlflag_checking=1 ; ac_gc_checking=1 ; ac_rtlflag_checking=1 ; ac_runtime_checking=1;
ac_gc_always_collect=1 ; ac_fold_checking=1 ;; ac_gc_checking=1 ; ac_gc_always_collect=1 ;
release) ac_assert_checking=1 ;; ac_fold_checking=1 ;;
release) ac_assert_checking=1 ; ac_runtime_checking=1 ;;
assert) ac_assert_checking=1 ;; assert) ac_assert_checking=1 ;;
fold) ac_fold_checking=1 ;; fold) ac_fold_checking=1 ;;
gc) ac_gc_checking=1 ;; gc) ac_gc_checking=1 ;;
...@@ -6304,6 +6306,7 @@ do ...@@ -6304,6 +6306,7 @@ do
misc) ac_checking=1 ;; misc) ac_checking=1 ;;
rtlflag) ac_rtlflag_checking=1 ;; rtlflag) ac_rtlflag_checking=1 ;;
rtl) ac_rtl_checking=1 ;; rtl) ac_rtl_checking=1 ;;
runtime) ac_runtime_checking=1 ;;
tree) ac_tree_checking=1 ;; tree) ac_tree_checking=1 ;;
valgrind) ac_checking_valgrind=1 ;; valgrind) ac_checking_valgrind=1 ;;
*) { { echo "$as_me:$LINENO: error: unknown check category $check" >&5 *) { { echo "$as_me:$LINENO: error: unknown check category $check" >&5
...@@ -6330,6 +6333,13 @@ cat >>confdefs.h <<\_ACEOF ...@@ -6330,6 +6333,13 @@ cat >>confdefs.h <<\_ACEOF
_ACEOF _ACEOF
fi fi
if test x$ac_runtime_checking != x ; then
cat >>confdefs.h <<\_ACEOF
#define ENABLE_RUNTIME_CHECKING 1
_ACEOF
fi
if test x$ac_tree_checking != x ; then if test x$ac_tree_checking != x ; then
cat >>confdefs.h <<\_ACEOF cat >>confdefs.h <<\_ACEOF
......
...@@ -394,7 +394,7 @@ AC_ARG_ENABLE(checking, ...@@ -394,7 +394,7 @@ AC_ARG_ENABLE(checking,
enable expensive run-time checks. With LIST, enable expensive run-time checks. With LIST,
enable only specific categories of checks. enable only specific categories of checks.
Categories are: assert,fold,gc,gcac,misc, Categories are: assert,fold,gc,gcac,misc,
rtlflag,rtl,tree,valgrind,release,yes,all;], rtlflag,rtl,runtime,tree,valgrind,release,yes,all;],
[ac_checking_flags="${enableval}"],[ [ac_checking_flags="${enableval}"],[
# Determine the default checks. # Determine the default checks.
if test x$is_release = x ; then if test x$is_release = x ; then
...@@ -407,6 +407,7 @@ ac_checking= ...@@ -407,6 +407,7 @@ ac_checking=
ac_tree_checking= ac_tree_checking=
ac_rtl_checking= ac_rtl_checking=
ac_rtlflag_checking= ac_rtlflag_checking=
ac_runtime_checking=1
ac_gc_checking= ac_gc_checking=
ac_gc_always_collect= ac_gc_always_collect=
ac_fold_checking= ac_fold_checking=
...@@ -416,16 +417,17 @@ do ...@@ -416,16 +417,17 @@ do
case $check in case $check in
yes) ac_assert_checking=1 ; ac_checking=1 ; yes) ac_assert_checking=1 ; ac_checking=1 ;
ac_tree_checking=1 ; ac_gc_checking=1 ; ac_tree_checking=1 ; ac_gc_checking=1 ;
ac_rtlflag_checking=1 ;; ac_rtlflag_checking=1 ; ac_runtime_checking=1 ;;
no) ac_assert_checking= ; ac_checking= ; no) ac_assert_checking= ; ac_checking= ;
ac_tree_checking= ; ac_rtl_checking= ; ac_tree_checking= ; ac_rtl_checking= ;
ac_rtlflag_checking= ; ac_gc_checking= ; ac_rtlflag_checking= ; ac_gc_checking= ;
ac_gc_always_collect= ; ac_fold_checking= ;; ac_gc_always_collect= ; ac_fold_checking= ;;
all) ac_assert_checking=1 ; ac_checking=1 ; all) ac_assert_checking=1 ; ac_checking=1 ;
ac_tree_checking=1 ; ac_rtl_checking=1 ; ac_tree_checking=1 ; ac_rtl_checking=1 ;
ac_rtlflag_checking=1 ; ac_gc_checking=1 ; ac_rtlflag_checking=1 ; ac_runtime_checking=1;
ac_gc_always_collect=1 ; ac_fold_checking=1 ;; ac_gc_checking=1 ; ac_gc_always_collect=1 ;
release) ac_assert_checking=1 ;; ac_fold_checking=1 ;;
release) ac_assert_checking=1 ; ac_runtime_checking=1 ;;
assert) ac_assert_checking=1 ;; assert) ac_assert_checking=1 ;;
fold) ac_fold_checking=1 ;; fold) ac_fold_checking=1 ;;
gc) ac_gc_checking=1 ;; gc) ac_gc_checking=1 ;;
...@@ -433,6 +435,7 @@ do ...@@ -433,6 +435,7 @@ do
misc) ac_checking=1 ;; misc) ac_checking=1 ;;
rtlflag) ac_rtlflag_checking=1 ;; rtlflag) ac_rtlflag_checking=1 ;;
rtl) ac_rtl_checking=1 ;; rtl) ac_rtl_checking=1 ;;
runtime) ac_runtime_checking=1 ;;
tree) ac_tree_checking=1 ;; tree) ac_tree_checking=1 ;;
valgrind) ac_checking_valgrind=1 ;; valgrind) ac_checking_valgrind=1 ;;
*) AC_MSG_ERROR(unknown check category $check) ;; *) AC_MSG_ERROR(unknown check category $check) ;;
...@@ -452,6 +455,10 @@ if test x$ac_assert_checking != x ; then ...@@ -452,6 +455,10 @@ if test x$ac_assert_checking != x ; then
AC_DEFINE(ENABLE_ASSERT_CHECKING, 1, AC_DEFINE(ENABLE_ASSERT_CHECKING, 1,
[Define if you want assertions enabled. This is a cheap check.]) [Define if you want assertions enabled. This is a cheap check.])
fi fi
if test x$ac_runtime_checking != x ; then
AC_DEFINE(ENABLE_RUNTIME_CHECKING, 1,
[Define if you want runtime assertions enabled. This is a cheap check.])
fi
if test x$ac_tree_checking != x ; then if test x$ac_tree_checking != x ; then
AC_DEFINE(ENABLE_TREE_CHECKING, 1, AC_DEFINE(ENABLE_TREE_CHECKING, 1,
[Define if you want all operations on trees (the basic data [Define if you want all operations on trees (the basic data
......
...@@ -1114,20 +1114,21 @@ with GCC@. This is on by default when building from CVS or snapshots, ...@@ -1114,20 +1114,21 @@ with GCC@. This is on by default when building from CVS or snapshots,
but off for releases. More control over the checks may be had by but off for releases. More control over the checks may be had by
specifying @var{list}; the categories of checks available are specifying @var{list}; the categories of checks available are
@samp{release}, @samp{assert}, @samp{misc}, @samp{tree}, @samp{gc}, @samp{release}, @samp{assert}, @samp{misc}, @samp{tree}, @samp{gc},
@samp{rtl}, @samp{rtlflag}, @samp{fold}, @samp{gcac} and @samp{rtl}, @samp{rtlflag}, @samp{runtime}, @samp{fold}, @samp{gcac} and
@samp{valgrind}. The @samp{release} category enables only those checks @samp{valgrind}. The @samp{release} category enables only those checks
suitable for release builds, currently this is just @samp{assert}. The suitable for release builds, currently this is @samp{assert} and
check @samp{valgrind} requires the external @command{valgrind} @samp{runtime}. The check @samp{valgrind} requires the external
simulator, available from @uref{http://valgrind.kde.org/}. The checks @command{valgrind} simulator, available from
@samp{rtl}, @samp{gcac} and @samp{valgrind} are very expensive. The @uref{http://valgrind.kde.org/}. The checks @samp{rtl}, @samp{gcac} and
default when @var{list} is not specified is @samp{valgrind} are very expensive. The default when @var{list} is not
@samp{assert,misc,tree,gc,rtlflag}. That is also the default for specified is @samp{assert,misc,tree,gc,rtlflag,runtime}. That is also
development builds, when @samp{--enable-checking} is not specified. For the default for development builds, when @samp{--enable-checking} is not
release builds the default, when @samp{--enable-checking} is not given, specified. For release builds the default, when
is @samp{release}. To disable all checking, @samp{--disable-checking} @samp{--enable-checking} is not given, is @samp{release}. To disable
must be explicitly requested. Disabling assertions will make the all checking, @samp{--disable-checking} must be explicitly requested.
compiler slightly faster but increase the risk of undetected internal Disabling assertions will make the compiler and runtime slightly faster
errors causing wrong code to be generated. but increase the risk of undetected internal errors causing wrong code
to be generated.
@item --enable-coverage @item --enable-coverage
@itemx --enable-coverage=@var{level} @itemx --enable-coverage=@var{level}
......
...@@ -121,4 +121,14 @@ extern int errno; ...@@ -121,4 +121,14 @@ extern int errno;
#undef alloca #undef alloca
#define alloca(x) __builtin_alloca(x) #define alloca(x) __builtin_alloca(x)
#ifdef ENABLE_RUNTIME_CHECKING
#define gcc_assert(EXPR) ((void)(!(EXPR) ? abort (), 0 : 0))
#else
/* 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
unreachable default case of a switch. Do not use gcc_assert(0). */
#define gcc_unreachable() (abort ())
#endif /* ! GCC_TSYSTEM_H */ #endif /* ! GCC_TSYSTEM_H */
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