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
This commit is contained in:
Nathan Sidwell 2005-03-24 14:09:06 +00:00 committed by Nathan Sidwell
parent 0a2198f512
commit b53ef39560
6 changed files with 62 additions and 23 deletions

View File

@ -1,3 +1,11 @@
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>
* optabs.h (enum optab_index): Remove OTI_llrint.

View File

@ -54,6 +54,9 @@
that are supported for each access macro. This is relatively cheap. */
#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
front ends) to be checked for dynamic type safety at runtime. This is
moderately expensive. The tree browser debugging routines will also be

20
gcc/configure vendored
View File

@ -868,7 +868,7 @@ Optional Features:
enable expensive run-time checks. With LIST,
enable only specific categories of checks.
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-coverage=LEVEL
enable compiler's code coverage collection.
@ -6278,6 +6278,7 @@ ac_checking=
ac_tree_checking=
ac_rtl_checking=
ac_rtlflag_checking=
ac_runtime_checking=1
ac_gc_checking=
ac_gc_always_collect=
ac_fold_checking=
@ -6287,16 +6288,17 @@ do
case $check in
yes) ac_assert_checking=1 ; ac_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= ;
ac_tree_checking= ; ac_rtl_checking= ;
ac_rtlflag_checking= ; ac_gc_checking= ;
ac_gc_always_collect= ; ac_fold_checking= ;;
all) ac_assert_checking=1 ; ac_checking=1 ;
ac_tree_checking=1 ; ac_rtl_checking=1 ;
ac_rtlflag_checking=1 ; ac_gc_checking=1 ;
ac_gc_always_collect=1 ; ac_fold_checking=1 ;;
release) ac_assert_checking=1 ;;
ac_rtlflag_checking=1 ; ac_runtime_checking=1;
ac_gc_checking=1 ; ac_gc_always_collect=1 ;
ac_fold_checking=1 ;;
release) ac_assert_checking=1 ; ac_runtime_checking=1 ;;
assert) ac_assert_checking=1 ;;
fold) ac_fold_checking=1 ;;
gc) ac_gc_checking=1 ;;
@ -6304,6 +6306,7 @@ do
misc) ac_checking=1 ;;
rtlflag) ac_rtlflag_checking=1 ;;
rtl) ac_rtl_checking=1 ;;
runtime) ac_runtime_checking=1 ;;
tree) ac_tree_checking=1 ;;
valgrind) ac_checking_valgrind=1 ;;
*) { { echo "$as_me:$LINENO: error: unknown check category $check" >&5
@ -6329,6 +6332,13 @@ cat >>confdefs.h <<\_ACEOF
#define ENABLE_ASSERT_CHECKING 1
_ACEOF
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

View File

@ -394,7 +394,7 @@ AC_ARG_ENABLE(checking,
enable expensive run-time checks. With LIST,
enable only specific categories of checks.
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}"],[
# Determine the default checks.
if test x$is_release = x ; then
@ -407,6 +407,7 @@ ac_checking=
ac_tree_checking=
ac_rtl_checking=
ac_rtlflag_checking=
ac_runtime_checking=1
ac_gc_checking=
ac_gc_always_collect=
ac_fold_checking=
@ -416,16 +417,17 @@ do
case $check in
yes) ac_assert_checking=1 ; ac_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= ;
ac_tree_checking= ; ac_rtl_checking= ;
ac_rtlflag_checking= ; ac_gc_checking= ;
ac_gc_always_collect= ; ac_fold_checking= ;;
all) ac_assert_checking=1 ; ac_checking=1 ;
ac_tree_checking=1 ; ac_rtl_checking=1 ;
ac_rtlflag_checking=1 ; ac_gc_checking=1 ;
ac_gc_always_collect=1 ; ac_fold_checking=1 ;;
release) ac_assert_checking=1 ;;
ac_rtlflag_checking=1 ; ac_runtime_checking=1;
ac_gc_checking=1 ; ac_gc_always_collect=1 ;
ac_fold_checking=1 ;;
release) ac_assert_checking=1 ; ac_runtime_checking=1 ;;
assert) ac_assert_checking=1 ;;
fold) ac_fold_checking=1 ;;
gc) ac_gc_checking=1 ;;
@ -433,6 +435,7 @@ do
misc) ac_checking=1 ;;
rtlflag) ac_rtlflag_checking=1 ;;
rtl) ac_rtl_checking=1 ;;
runtime) ac_runtime_checking=1 ;;
tree) ac_tree_checking=1 ;;
valgrind) ac_checking_valgrind=1 ;;
*) AC_MSG_ERROR(unknown check category $check) ;;
@ -452,6 +455,10 @@ if test x$ac_assert_checking != x ; then
AC_DEFINE(ENABLE_ASSERT_CHECKING, 1,
[Define if you want assertions enabled. This is a cheap check.])
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
AC_DEFINE(ENABLE_TREE_CHECKING, 1,
[Define if you want all operations on trees (the basic data

View File

@ -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
specifying @var{list}; the categories of checks available are
@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
suitable for release builds, currently this is just @samp{assert}. The
check @samp{valgrind} requires the external @command{valgrind}
simulator, available from @uref{http://valgrind.kde.org/}. The checks
@samp{rtl}, @samp{gcac} and @samp{valgrind} are very expensive. The
default when @var{list} is not specified is
@samp{assert,misc,tree,gc,rtlflag}. That is also the default for
development builds, when @samp{--enable-checking} is not specified. For
release builds the default, when @samp{--enable-checking} is not given,
is @samp{release}. To disable all checking, @samp{--disable-checking}
must be explicitly requested. Disabling assertions will make the
compiler slightly faster but increase the risk of undetected internal
errors causing wrong code to be generated.
suitable for release builds, currently this is @samp{assert} and
@samp{runtime}. The check @samp{valgrind} requires the external
@command{valgrind} simulator, available from
@uref{http://valgrind.kde.org/}. The checks @samp{rtl}, @samp{gcac} and
@samp{valgrind} are very expensive. The default when @var{list} is not
specified is @samp{assert,misc,tree,gc,rtlflag,runtime}. That is also
the default for development builds, when @samp{--enable-checking} is not
specified. For release builds the default, when
@samp{--enable-checking} is not given, is @samp{release}. To disable
all checking, @samp{--disable-checking} must be explicitly requested.
Disabling assertions will make the compiler and runtime slightly faster
but increase the risk of undetected internal errors causing wrong code
to be generated.
@item --enable-coverage
@itemx --enable-coverage=@var{level}

View File

@ -121,4 +121,14 @@ extern int errno;
#undef alloca
#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 */