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, committed] Enable special flag for df checking


This patch (committed because the df bits are trivial) adds a --enable-checking=df flag. It will be removed from --enable-checking=yes in a few weeks.

Paolo
2007-06-14  Paolo Bonzini  <bonzini@gnu.org>

	* configure.ac: Add --enable-checking=df.
	* df-core.c: Use it.
	* configure: Regenerate.
	* config.in: Regenerate.

Index: configure.ac
===================================================================
--- configure.ac	(revision 125670)
+++ configure.ac	(working copy)
@@ -435,7 +435,7 @@ AC_ARG_ENABLE(checking,
 			  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,
+			  Flags are: assert,df,fold,gc,gcac,misc,
 			  rtlflag,rtl,runtime,tree,valgrind.],
 [ac_checking_flags="${enableval}"],[
 # Determine the default checks.
@@ -444,43 +444,34 @@ if test x$is_release = x ; then
 else
   ac_checking_flags=release
 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
+for check in release,$ac_checking_flags
 do
 	case $check in
 	# these set all the flags to specific states
-	yes)		ac_assert_checking=1 ; ac_checking=1 ;
+	yes)		ac_assert_checking=1 ; ac_checking=1 ; ac_df_checking=1 ;
 			ac_fold_checking= ; ac_gc_checking=1 ;
 			ac_gc_always_collect= ; ac_rtl_checking= ;
 			ac_rtlflag_checking=1 ; ac_runtime_checking=1 ;
 			ac_tree_checking=1 ; ac_valgrind_checking= ;;
-	no|none)	ac_assert_checking= ; ac_checking= ;
+	no|none)	ac_assert_checking= ; ac_checking= ; ac_df_checking= ;
 			ac_fold_checking= ; ac_gc_checking= ;
 			ac_gc_always_collect= ; ac_rtl_checking= ;
 			ac_rtlflag_checking= ; ac_runtime_checking= ;
 			ac_tree_checking= ; ac_valgrind_checking= ;;
-	all)		ac_assert_checking=1 ; ac_checking=1 ;
+	all)		ac_assert_checking=1 ; ac_checking=1 ; ac_df_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= ;
+	release)	ac_assert_checking=1 ; ac_checking= ; ac_df_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 ;;
+	df)	 	ac_df_checking=1 ;;
 	fold)		ac_fold_checking=1 ;;
 	gc)		ac_gc_checking=1 ;;
 	gcac)		ac_gc_always_collect=1 ;;
@@ -503,6 +494,10 @@ if test x$ac_checking != x ; then
   nocommon_flag=-fno-common
 fi
 AC_SUBST(nocommon_flag)
+if test x$ac_df_checking != x ; then
+  AC_DEFINE(ENABLE_DF_CHECKING, 1,
+[Define if you want more run-time sanity checks for dataflow.])
+fi
 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.])
Index: df-core.c
===================================================================
--- df-core.c	(revision 125670)
+++ df-core.c	(working copy)
@@ -644,7 +644,7 @@ df_finish_pass (void)
   int i;
   int removed = 0;
 
-#ifdef ENABLE_CHECKING
+#ifdef ENABLE_DF_CHECKING
   enum df_changeable_flags saved_flags;
 #endif
 
@@ -654,7 +654,7 @@ df_finish_pass (void)
   df_maybe_reorganize_def_refs (DF_REF_ORDER_NO_TABLE);
   df_maybe_reorganize_use_refs (DF_REF_ORDER_NO_TABLE);
 
-#ifdef ENABLE_CHECKING
+#ifdef ENABLE_DF_CHECKING
   saved_flags = df->changeable_flags;
 #endif
 
@@ -684,7 +684,7 @@ df_finish_pass (void)
       df->analyze_subset = false;
     }
 
-#ifdef ENABLE_CHECKING
+#ifdef ENABLE_DF_CHECKING
   /* Verification will fail in DF_NO_INSN_RESCAN.  */
   if (!(saved_flags & DF_NO_INSN_RESCAN))
     {
@@ -1040,7 +1040,7 @@ df_analyze_problem (struct dataflow *dfl
 {
   timevar_push (dflow->problem->tv_id);
 
-#ifdef ENABLE_CHECKING
+#ifdef ENABLE_DF_CHECKING
   if (dflow->problem->verify_start_fun)
     dflow->problem->verify_start_fun ();
 #endif
@@ -1062,7 +1062,7 @@ df_analyze_problem (struct dataflow *dfl
   if (dflow->problem->finalize_fun)
     dflow->problem->finalize_fun (blocks_to_consider);
 
-#ifdef ENABLE_CHECKING
+#ifdef ENABLE_DF_CHECKING
   if (dflow->problem->verify_end_fun)
     dflow->problem->verify_end_fun ();
 #endif
@@ -1100,9 +1100,10 @@ df_analyze (void)
   df_compute_regs_ever_live (false);
   df_process_deferred_rescans ();
 
-#ifdef ENABLE_CHECKING
   if (dump_file)
     fprintf (dump_file, "df_analyze called\n");
+
+#ifdef ENABLE_DF_CHECKING
   df_verify ();
 #endif 
 

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