This goes forward with an old idea of doing IL verification after
each pass.  This is a baby-step towards it by adding TODO_verify_il,
auto-added by the pass manager at the todo-after position.  It
moves loop-closed SSA verification (which was done whenever loops
were in loop-closed SSA form - before _and_ after a pass...)
under the TODO_verify_il umbrella.

Bootstrap/regtest ongoing on x86_64-unknown-linux-gnu.

I'm proposing to remove TODO_verify_* by enabling them under
TODO_verify_il.

Any comments?

Thansk,
Richard.

2014-04-23  Richard Biener  <rguent...@suse.de>

        * tree-pass.h (TODO_verify_il): Define.
        (TODO_verify_all): Complete properly.
        * passes.c (execute_function_todo): Move existing loop-closed
        SSA verification under TODO_verify_il.
        (execute_one_pass): Trigger TODO_verify_il at todo-after time.

Index: gcc/tree-pass.h
===================================================================
--- gcc/tree-pass.h     (revision 209677)
+++ gcc/tree-pass.h     (working copy)
@@ -234,6 +234,7 @@ protected:
 #define TODO_verify_flow               (1 << 3)
 #define TODO_verify_stmts              (1 << 4)
 #define TODO_cleanup_cfg               (1 << 5)
+#define TODO_verify_il                 (1 << 6)
 #define TODO_dump_symtab               (1 << 7)
 #define TODO_remove_functions          (1 << 8)
 #define TODO_rebuild_frequencies       (1 << 9)
@@ -309,7 +310,8 @@ protected:
      | TODO_update_ssa_only_virtuals)
 
 #define TODO_verify_all \
-  (TODO_verify_ssa | TODO_verify_flow | TODO_verify_stmts)
+  (TODO_verify_ssa | TODO_verify_flow | TODO_verify_stmts | TODO_verify_il \
+   | TODO_verify_rtl_sharing)
 
 
 /* Register pass info. */
Index: gcc/passes.c
===================================================================
--- gcc/passes.c        (revision 209677)
+++ gcc/passes.c        (working copy)
@@ -1777,8 +1777,7 @@ execute_function_todo (void *data)
     return;
 
 #if defined ENABLE_CHECKING
-  if (flags & TODO_verify_ssa
-      || (current_loops && loops_state_satisfies_p (LOOP_CLOSED_SSA)))
+  if (flags & TODO_verify_ssa)
     {
       verify_gimple_in_cfg (cfun);
       verify_ssa (true);
@@ -1787,8 +1786,18 @@ execute_function_todo (void *data)
     verify_gimple_in_cfg (cfun);
   if (flags & TODO_verify_flow)
     verify_flow_info ();
-  if (current_loops && loops_state_satisfies_p (LOOP_CLOSED_SSA))
-    verify_loop_closed_ssa (false);
+  if (flags & TODO_verify_il)
+    {
+      if (current_loops
+         && loops_state_satisfies_p (LOOP_CLOSED_SSA))
+       {
+         if (!(flags & (TODO_verify_stmts|TODO_verify_ssa)))
+           verify_gimple_in_cfg (cfun);
+         if (!(flags & TODO_verify_ssa))
+           verify_ssa (true);
+         verify_loop_closed_ssa (false);
+       }
+    }
   if (flags & TODO_verify_rtl_sharing)
     verify_rtl_sharing ();
 #endif
@@ -2170,7 +2179,7 @@ execute_one_pass (opt_pass *pass)
     check_profile_consistency (pass->static_pass_number, 0, true);
 
   /* Run post-pass cleanup and verification.  */
-  execute_todo (todo_after | pass->todo_flags_finish);
+  execute_todo (todo_after | pass->todo_flags_finish | TODO_verify_il);
   if (profile_report && cfun && (cfun->curr_properties & PROP_cfg))
     check_profile_consistency (pass->static_pass_number, 1, true);
 

Reply via email to