This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Tidy --enable-checking


This patch tidies up the enable-checking handling during configure. I found
it hard to ensure all the flags were being set correctly without alphabetizing
them, and mentining them all in the switches that set several of them.  Whilst
there I updated the documentation to distinguish between categories of flage
and individual flags.  I added a 'none' synonym for 'no'.

Installed as obvious.

nathan
--
Nathan Sidwell    ::   http://www.codesourcery.com   ::     CodeSourcery LLC
nathan@codesourcery.com    ::     http://www.planetfall.pwp.blueyonder.co.uk

2005-04-01  Nathan Sidwell  <nathan@codesourcery.com>

	* configure.ac (enable-checking): Explicitly set all variables for
	collective switch values.  Alphabetize variables. Rename
	ac_checking_valgrind to ac_valgrind_checking.  Allow 'none' as
	synonym for 'no'.
	* doc/install.texi (enable-checking): Update documentation.
	* configure: Rebuilt.

Index: configure.ac
===================================================================
RCS file: /cvs/gcc/gcc/gcc/configure.ac,v
retrieving revision 2.102
diff -c -3 -p -r2.102 configure.ac
*** configure.ac	30 Mar 2005 08:18:03 -0000	2.102
--- configure.ac	1 Apr 2005 13:45:41 -0000
*************** AC_ARG_ENABLE(checking,
*** 393,400 ****
  [  --enable-checking[=LIST]
  			  enable expensive run-time checks.  With LIST,
  			  enable only specific categories of checks.
! 			  Categories are: assert,fold,gc,gcac,misc,
! 			  rtlflag,rtl,runtime,tree,valgrind,release,yes,all;],
  [ac_checking_flags="${enableval}"],[
  # Determine the default checks.
  if test x$is_release = x ; then
--- 393,401 ----
  [  --enable-checking[=LIST]
  			  enable expensive run-time checks.  With LIST,
  			  enable only specific categories of checks.
! 			  Categories are: yes,no,all,none,release.
! 			  Flags are: assert,fold,gc,gcac,misc,
! 			  rtlflag,rtl,runtime,tree,valgrind.],
  [ac_checking_flags="${enableval}"],[
  # Determine the default checks.
  if test x$is_release = x ; then
*************** else
*** 404,443 ****
  fi])
  ac_assert_checking=1
  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=
  IFS="${IFS= 	}"; ac_save_IFS="$IFS"; IFS="$IFS,"
  for check in $ac_checking_flags
  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_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_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 ;;
  	gcac)		ac_gc_always_collect=1 ;;
  	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) ;;
  	esac
  done
--- 405,454 ----
  fi])
  ac_assert_checking=1
  ac_checking=
! ac_fold_checking=
! ac_gc_checking=
! ac_gc_always_collect=
  ac_rtl_checking=
  ac_rtlflag_checking=
  ac_runtime_checking=1
! ac_tree_checking=
! ac_valgrind_checking=
  IFS="${IFS= 	}"; ac_save_IFS="$IFS"; IFS="$IFS,"
  for check in $ac_checking_flags
  do
  	case $check in
+ 	# these set all the flags to specific states
  	yes)		ac_assert_checking=1 ; ac_checking=1 ;
! 			ac_fold_checking= ; ac_gc_checking=1 ;
! 			ac_gc_always_collect= ; ac_rtl_checking= ;
! 			ac_rtlflag_checking=1 ; ac_runtime_chacking=1 ;
! 			ac_tree_checking=1 ; ac_valgrind_checking= ;;
! 	no|none)	ac_assert_checking= ; ac_checking= ;
! 			ac_fold_checking= ; ac_gc_checking= ;
! 			ac_gc_always_collect= ; ac_rtl_checking= ;
! 			ac_rtlflag_checking= ; ac_runtime_chacking= ;
! 			ac_tree_checking= ; ac_valgrind_checking= ;;
  	all)		ac_assert_checking=1 ; ac_checking=1 ;
! 			ac_fold_checking=1 ; ac_gc_checking=1 ;
! 			ac_gc_always_collect=1 ; ac_rtl_checking=1 ;
! 			ac_rtlflag_checking=1 ; ac_runtime_checking=1 ;
! 			ac_tree_checking=1 ; ac_valgrind_checking= ;;
! 	release)	ac_assert_checking=1 ; ac_checking= ;
! 			ac_fold_checking= ; ac_gc_checking= ;
! 			ac_gc_always_collect= ; ac_rtl_checking= ;
! 			ac_rtlflag_checking= ; ac_runtime_checking=1 ;
! 			ac_tree_checking= ; ac_valgrind_checking= ;;
! 	# these enable particular checks
  	assert) 	ac_assert_checking=1 ;;
  	fold)		ac_fold_checking=1 ;;
  	gc)		ac_gc_checking=1 ;;
  	gcac)		ac_gc_always_collect=1 ;;
  	misc)		ac_checking=1 ;;
  	rtl)		ac_rtl_checking=1 ;;
+ 	rtlflag)	ac_rtlflag_checking=1 ;;
  	runtime)	ac_runtime_checking=1 ;;
  	tree)		ac_tree_checking=1 ;;
! 	valgrind)	ac_valgrind_checking=1 ;;
  	*)	AC_MSG_ERROR(unknown check category $check) ;;
  	esac
  done
*************** dnl # an if statement.  This was the sou
*** 505,511 ****
  dnl # in converting to autoconf 2.5x!
  AC_CHECK_HEADER(valgrind.h, have_valgrind_h=yes, have_valgrind_h=no)
  
! if test x$ac_checking_valgrind != x ; then
    # It is certainly possible that there's valgrind but no valgrind.h.
    # GCC relies on making annotations so we must have both.
    AC_MSG_CHECKING(for VALGRIND_DISCARD in <valgrind/memcheck.h>)
--- 516,522 ----
  dnl # in converting to autoconf 2.5x!
  AC_CHECK_HEADER(valgrind.h, have_valgrind_h=yes, have_valgrind_h=no)
  
! if test x$ac_valgrind_checking != x ; then
    # It is certainly possible that there's valgrind but no valgrind.h.
    # GCC relies on making annotations so we must have both.
    AC_MSG_CHECKING(for VALGRIND_DISCARD in <valgrind/memcheck.h>)
Index: configure
===================================================================
RCS file: /cvs/gcc/gcc/gcc/configure,v
retrieving revision 1.894
diff -c -3 -p -r1.894 configure
*** configure	30 Mar 2005 08:18:02 -0000	1.894
--- configure	1 Apr 2005 13:46:14 -0000
*************** Optional Features:
*** 867,874 ****
    --enable-checking=LIST
  			  enable expensive run-time checks.  With LIST,
  			  enable only specific categories of checks.
! 			  Categories are: assert,fold,gc,gcac,misc,
! 			  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.
--- 867,875 ----
    --enable-checking=LIST
  			  enable expensive run-time checks.  With LIST,
  			  enable only specific categories of checks.
! 			  Categories are: yes,no,all,none,release.
! 			  Flags are: assert,fold,gc,gcac,misc,
! 			  rtlflag,rtl,runtime,tree,valgrind.
    --enable-mapped-location   location_t is fileline integer cookie
    --enable-coverage=LEVEL
  			  enable compiler's code coverage collection.
*************** fi
*** 6275,6314 ****
  fi;
  ac_assert_checking=1
  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=
  IFS="${IFS= 	}"; ac_save_IFS="$IFS"; IFS="$IFS,"
  for check in $ac_checking_flags
  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_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_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 ;;
  	gcac)		ac_gc_always_collect=1 ;;
  	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
  echo "$as_me: error: unknown check category $check" >&2;}
     { (exit 1); exit 1; }; } ;;
--- 6276,6325 ----
  fi;
  ac_assert_checking=1
  ac_checking=
! ac_fold_checking=
! ac_gc_checking=
! ac_gc_always_collect=
  ac_rtl_checking=
  ac_rtlflag_checking=
  ac_runtime_checking=1
! ac_tree_checking=
! ac_valgrind_checking=
  IFS="${IFS= 	}"; ac_save_IFS="$IFS"; IFS="$IFS,"
  for check in $ac_checking_flags
  do
  	case $check in
+ 	# these set all the flags to specific states
  	yes)		ac_assert_checking=1 ; ac_checking=1 ;
! 			ac_fold_checking= ; ac_gc_checking=1 ;
! 			ac_gc_always_collect= ; ac_rtl_checking= ;
! 			ac_rtlflag_checking=1 ; ac_runtime_chacking=1 ;
! 			ac_tree_checking=1 ; ac_valgrind_checking= ;;
! 	no|none)	ac_assert_checking= ; ac_checking= ;
! 			ac_fold_checking= ; ac_gc_checking= ;
! 			ac_gc_always_collect= ; ac_rtl_checking= ;
! 			ac_rtlflag_checking= ; ac_runtime_chacking= ;
! 			ac_tree_checking= ; ac_valgrind_checking= ;;
  	all)		ac_assert_checking=1 ; ac_checking=1 ;
! 			ac_fold_checking=1 ; ac_gc_checking=1 ;
! 			ac_gc_always_collect=1 ; ac_rtl_checking=1 ;
! 			ac_rtlflag_checking=1 ; ac_runtime_checking=1 ;
! 			ac_tree_checking=1 ; ac_valgrind_checking= ;;
! 	release)	ac_assert_checking=1 ; ac_checking= ;
! 			ac_fold_checking= ; ac_gc_checking= ;
! 			ac_gc_always_collect= ; ac_rtl_checking= ;
! 			ac_rtlflag_checking= ; ac_runtime_checking=1 ;
! 			ac_tree_checking= ; ac_valgrind_checking= ;;
! 	# these enable particular checks
  	assert) 	ac_assert_checking=1 ;;
  	fold)		ac_fold_checking=1 ;;
  	gc)		ac_gc_checking=1 ;;
  	gcac)		ac_gc_always_collect=1 ;;
  	misc)		ac_checking=1 ;;
  	rtl)		ac_rtl_checking=1 ;;
+ 	rtlflag)	ac_rtlflag_checking=1 ;;
  	runtime)	ac_runtime_checking=1 ;;
  	tree)		ac_tree_checking=1 ;;
! 	valgrind)	ac_valgrind_checking=1 ;;
  	*)	{ { echo "$as_me:$LINENO: error: unknown check category $check" >&5
  echo "$as_me: error: unknown check category $check" >&2;}
     { (exit 1); exit 1; }; } ;;
*************** fi
*** 6532,6538 ****
  
  
  
! if test x$ac_checking_valgrind != x ; then
    # It is certainly possible that there's valgrind but no valgrind.h.
    # GCC relies on making annotations so we must have both.
    echo "$as_me:$LINENO: checking for VALGRIND_DISCARD in <valgrind/memcheck.h>" >&5
--- 6543,6549 ----
  
  
  
! if test x$ac_valgrind_checking != x ; then
    # It is certainly possible that there's valgrind but no valgrind.h.
    # GCC relies on making annotations so we must have both.
    echo "$as_me:$LINENO: checking for VALGRIND_DISCARD in <valgrind/memcheck.h>" >&5
*************** if test "${gcc_cv_prog_makeinfo_modern+s
*** 7388,7394 ****
  else
      ac_prog_version=`$MAKEINFO --version 2>&1 |
                     sed -n 's/^.*GNU texinfo.* \([0-9][0-9.]*\).*$/\1/p'`
!   echo "configure:7381: version of makeinfo is $ac_prog_version" >&5
    case $ac_prog_version in
      '')     gcc_cv_prog_makeinfo_modern=no;;
      4.[2-9]*)
--- 7399,7405 ----
  else
      ac_prog_version=`$MAKEINFO --version 2>&1 |
                     sed -n 's/^.*GNU texinfo.* \([0-9][0-9.]*\).*$/\1/p'`
!   echo "configure:7402: version of makeinfo is $ac_prog_version" >&5
    case $ac_prog_version in
      '')     gcc_cv_prog_makeinfo_modern=no;;
      4.[2-9]*)
Index: doc/install.texi
===================================================================
RCS file: /cvs/gcc/gcc/gcc/doc/install.texi,v
retrieving revision 1.339
diff -c -3 -p -r1.339 install.texi
*** doc/install.texi	30 Mar 2005 07:24:22 -0000	1.339
--- doc/install.texi	1 Apr 2005 13:46:24 -0000
*************** controlled by the Makefiles.
*** 1099,1128 ****
  
  @item --enable-checking
  @itemx --enable-checking=@var{list}
! When you specify this option, the compiler is built to perform checking
! of tree node types when referencing fields of that node, and some other
! internal consistency checks.  This does not change the generated code,
! but adds error checking within the compiler.  This will slow down the
! compiler and may only work properly if you are building the compiler
! 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{runtime}, @samp{fold}, @samp{gcac} and
! @samp{valgrind}.  The @samp{release} category enables only those checks
! 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}
--- 1099,1127 ----
  
  @item --enable-checking
  @itemx --enable-checking=@var{list}
! When you specify this option, the compiler is built to perform internal
! constency checks of the requested complexity.  This does not change the
! generated code, but adds error checking within the compiler.  This will
! slow down the compiler and may only work properly if you are building
! the compiler with GCC@.  This is @samp{yes} by default when building
! from CVS or snapshots, but @samp{release} for releases.  More control
! over the checks may be had by specifying @var{list}.  The categories of
! checks available are @samp{yes} (most common checks
! @samp{assert,misc,tree,gc,rtlflag,runtime}), @samp{no} (no checks at
! all), @samp{all} (all but @samp{valgrind}), @samp{release} (cheapest
! checks @samp{assert,runtime}) or @samp{none} (same as @samp{no}).
! Individual checks can be enabled with these flags @samp{assert},
! @samp{fold}, @samp{gc}, @samp{gcac} @samp{misc}, @samp{rtl},
! @samp{rtlflag}, @samp{runtime}, @samp{tree}, and @samp{valgrind}.
! 
! The @samp{valgrind} check requires the external @command{valgrind}
! simulator, available from @uref{http://valgrind.kde.org/}.  The
! @samp{rtl}, @samp{gcac} and @samp{valgrind} checks are very expensive.
! To disable all checking, @samp{--disable-checking} or
! @samp{--enable-checking=none} 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}

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]