Commit e9ff9caf by Richard Biener Committed by Richard Biener

passes.c (execute_function_todo): Move TODO_verify_stmts and TODO_verify_ssa…

passes.c (execute_function_todo): Move TODO_verify_stmts and TODO_verify_ssa under the TODO_verify_il umbrella.

2014-04-30  Richard Biener  <rguenther@suse.de>

	* passes.c (execute_function_todo): Move TODO_verify_stmts
	and TODO_verify_ssa under the TODO_verify_il umbrella.
	* tree-ssa.h (verify_ssa): Adjust prototype.
	* tree-ssa.c (verify_ssa): Add parameter to tell whether
	we should verify SSA operands.
	* tree-cfg.h (verify_gimple_in_cfg): Adjust prototype.
	* tree-cfg.c (verify_gimple_in_cfg): Add parameter to tell
	whether we should verify whether not throwing stmts have EH info.
	* graphite-scop-detection.c (create_sese_edges): Adjust.
	* tree-ssa-loop-manip.c (verify_loop_closed_ssa): Likewise.
	* tree-eh.c (lower_try_finally_switch): Do not add the
	default case label twice.

From-SVN: r209928
parent f8ed5150
2014-04-30 Richard Biener <rguenther@suse.de>
* passes.c (execute_function_todo): Move TODO_verify_stmts
and TODO_verify_ssa under the TODO_verify_il umbrella.
* tree-ssa.h (verify_ssa): Adjust prototype.
* tree-ssa.c (verify_ssa): Add parameter to tell whether
we should verify SSA operands.
* tree-cfg.h (verify_gimple_in_cfg): Adjust prototype.
* tree-cfg.c (verify_gimple_in_cfg): Add parameter to tell
whether we should verify whether not throwing stmts have EH info.
* graphite-scop-detection.c (create_sese_edges): Adjust.
* tree-ssa-loop-manip.c (verify_loop_closed_ssa): Likewise.
* tree-eh.c (lower_try_finally_switch): Do not add the
default case label twice.
2014-04-30 Marek Polacek <polacek@redhat.com> 2014-04-30 Marek Polacek <polacek@redhat.com>
* gcc.c (sanitize_spec_function): Handle SANITIZE_FLOAT_DIVIDE. * gcc.c (sanitize_spec_function): Handle SANITIZE_FLOAT_DIVIDE.
......
...@@ -1056,7 +1056,7 @@ create_sese_edges (vec<sd_region> regions) ...@@ -1056,7 +1056,7 @@ create_sese_edges (vec<sd_region> regions)
#ifdef ENABLE_CHECKING #ifdef ENABLE_CHECKING
verify_loop_structure (); verify_loop_structure ();
verify_ssa (false); verify_ssa (false, true);
#endif #endif
} }
......
...@@ -1716,6 +1716,7 @@ pass_manager::dump_profile_report () const ...@@ -1716,6 +1716,7 @@ pass_manager::dump_profile_report () const
static void static void
execute_function_todo (function *fn, void *data) execute_function_todo (function *fn, void *data)
{ {
bool from_ipa_pass = (cfun == NULL);
unsigned int flags = (size_t)data; unsigned int flags = (size_t)data;
flags &= ~fn->last_verified; flags &= ~fn->last_verified;
if (!flags) if (!flags)
...@@ -1767,27 +1768,30 @@ execute_function_todo (function *fn, void *data) ...@@ -1767,27 +1768,30 @@ execute_function_todo (function *fn, void *data)
dom_state pre_verify_state = dom_info_state (fn, CDI_DOMINATORS); dom_state pre_verify_state = dom_info_state (fn, CDI_DOMINATORS);
dom_state pre_verify_pstate = dom_info_state (fn, CDI_POST_DOMINATORS); dom_state pre_verify_pstate = dom_info_state (fn, CDI_POST_DOMINATORS);
if (flags & TODO_verify_ssa) if (flags & TODO_verify_il)
{
if (cfun->curr_properties & PROP_trees)
{ {
verify_gimple_in_cfg (cfun); if (cfun->curr_properties & PROP_cfg)
verify_ssa (true); /* IPA passes leave stmts to be fixed up, so make sure to
not verify stmts really throw. */
verify_gimple_in_cfg (cfun, !from_ipa_pass);
else
verify_gimple_in_seq (gimple_body (cfun->decl));
}
if (cfun->curr_properties & PROP_ssa)
/* IPA passes leave stmts to be fixed up, so make sure to
not verify SSA operands whose verifier will choke on that. */
verify_ssa (true, !from_ipa_pass);
} }
else if (flags & TODO_verify_stmts)
verify_gimple_in_cfg (cfun);
if (flags & TODO_verify_flow) if (flags & TODO_verify_flow)
verify_flow_info (); verify_flow_info ();
if (flags & TODO_verify_il) if (flags & TODO_verify_il)
{ {
if (current_loops if (current_loops
&& loops_state_satisfies_p (LOOP_CLOSED_SSA)) && 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); verify_loop_closed_ssa (false);
} }
}
if (flags & TODO_verify_rtl_sharing) if (flags & TODO_verify_rtl_sharing)
verify_rtl_sharing (); verify_rtl_sharing ();
...@@ -1803,7 +1807,7 @@ execute_function_todo (function *fn, void *data) ...@@ -1803,7 +1807,7 @@ execute_function_todo (function *fn, void *data)
/* For IPA passes make sure to release dominator info, it can be /* For IPA passes make sure to release dominator info, it can be
computed by non-verifying TODOs. */ computed by non-verifying TODOs. */
if (!cfun) if (from_ipa_pass)
{ {
free_dominance_info (fn, CDI_DOMINATORS); free_dominance_info (fn, CDI_DOMINATORS);
free_dominance_info (fn, CDI_POST_DOMINATORS); free_dominance_info (fn, CDI_POST_DOMINATORS);
......
...@@ -4785,7 +4785,7 @@ collect_subblocks (pointer_set_t *blocks, tree block) ...@@ -4785,7 +4785,7 @@ collect_subblocks (pointer_set_t *blocks, tree block)
/* Verify the GIMPLE statements in the CFG of FN. */ /* Verify the GIMPLE statements in the CFG of FN. */
DEBUG_FUNCTION void DEBUG_FUNCTION void
verify_gimple_in_cfg (struct function *fn) verify_gimple_in_cfg (struct function *fn, bool verify_nothrow)
{ {
basic_block bb; basic_block bb;
bool err = false; bool err = false;
...@@ -4921,16 +4921,17 @@ verify_gimple_in_cfg (struct function *fn) ...@@ -4921,16 +4921,17 @@ verify_gimple_in_cfg (struct function *fn)
that they cannot throw, that we update other data structures that they cannot throw, that we update other data structures
to match. */ to match. */
lp_nr = lookup_stmt_eh_lp (stmt); lp_nr = lookup_stmt_eh_lp (stmt);
if (lp_nr != 0) if (lp_nr > 0)
{ {
if (!stmt_could_throw_p (stmt)) if (!stmt_could_throw_p (stmt))
{ {
if (verify_nothrow)
{
error ("statement marked for throw, but doesn%'t"); error ("statement marked for throw, but doesn%'t");
err2 |= true; err2 |= true;
} }
else if (lp_nr > 0 }
&& !gsi_one_before_end_p (gsi) else if (!gsi_one_before_end_p (gsi))
&& stmt_can_throw_internal (stmt))
{ {
error ("statement marked for throw in middle of block"); error ("statement marked for throw in middle of block");
err2 |= true; err2 |= true;
......
...@@ -58,7 +58,7 @@ extern gimple first_stmt (basic_block); ...@@ -58,7 +58,7 @@ extern gimple first_stmt (basic_block);
extern gimple last_stmt (basic_block); extern gimple last_stmt (basic_block);
extern gimple last_and_only_stmt (basic_block); extern gimple last_and_only_stmt (basic_block);
extern void verify_gimple_in_seq (gimple_seq); extern void verify_gimple_in_seq (gimple_seq);
extern void verify_gimple_in_cfg (struct function *); extern void verify_gimple_in_cfg (struct function *, bool);
extern tree gimple_block_label (basic_block); extern tree gimple_block_label (basic_block);
extern void add_phi_args_after_copy_bb (basic_block); extern void add_phi_args_after_copy_bb (basic_block);
extern void add_phi_args_after_copy (basic_block *, unsigned, edge); extern void add_phi_args_after_copy (basic_block *, unsigned, edge);
......
...@@ -1550,6 +1550,8 @@ lower_try_finally_switch (struct leh_state *state, struct leh_tf_state *tf) ...@@ -1550,6 +1550,8 @@ lower_try_finally_switch (struct leh_state *state, struct leh_tf_state *tf)
/* Make sure that the last case is the default label, as one is required. /* Make sure that the last case is the default label, as one is required.
Then sort the labels, which is also required in GIMPLE. */ Then sort the labels, which is also required in GIMPLE. */
CASE_LOW (last_case) = NULL; CASE_LOW (last_case) = NULL;
tree tem = case_label_vec.pop ();
gcc_assert (tem == last_case);
sort_case_labels (case_label_vec); sort_case_labels (case_label_vec);
/* Build the switch statement, setting last_case to be the default /* Build the switch statement, setting last_case to be the default
......
...@@ -598,7 +598,7 @@ verify_loop_closed_ssa (bool verify_ssa_p) ...@@ -598,7 +598,7 @@ verify_loop_closed_ssa (bool verify_ssa_p)
return; return;
if (verify_ssa_p) if (verify_ssa_p)
verify_ssa (false); verify_ssa (false, true);
timevar_push (TV_VERIFY_LOOP_CLOSED); timevar_push (TV_VERIFY_LOOP_CLOSED);
......
...@@ -959,7 +959,7 @@ error: ...@@ -959,7 +959,7 @@ error:
TODO: verify the variable annotations. */ TODO: verify the variable annotations. */
DEBUG_FUNCTION void DEBUG_FUNCTION void
verify_ssa (bool check_modified_stmt) verify_ssa (bool check_modified_stmt, bool check_ssa_operands)
{ {
size_t i; size_t i;
basic_block bb; basic_block bb;
...@@ -1042,7 +1042,7 @@ verify_ssa (bool check_modified_stmt) ...@@ -1042,7 +1042,7 @@ verify_ssa (bool check_modified_stmt)
goto err; goto err;
} }
if (verify_ssa_operands (cfun, stmt)) if (check_ssa_operands && verify_ssa_operands (cfun, stmt))
{ {
print_gimple_stmt (stderr, stmt, 0, TDF_VOPS); print_gimple_stmt (stderr, stmt, 0, TDF_VOPS);
goto err; goto err;
......
...@@ -45,7 +45,7 @@ extern void insert_debug_temp_for_var_def (gimple_stmt_iterator *, tree); ...@@ -45,7 +45,7 @@ extern void insert_debug_temp_for_var_def (gimple_stmt_iterator *, tree);
extern void insert_debug_temps_for_defs (gimple_stmt_iterator *); extern void insert_debug_temps_for_defs (gimple_stmt_iterator *);
extern void reset_debug_uses (gimple); extern void reset_debug_uses (gimple);
extern void release_defs_bitset (bitmap toremove); extern void release_defs_bitset (bitmap toremove);
extern void verify_ssa (bool); extern void verify_ssa (bool, bool);
extern void init_tree_ssa (struct function *); extern void init_tree_ssa (struct function *);
extern void delete_tree_ssa (void); extern void delete_tree_ssa (void);
extern bool tree_ssa_useless_type_conversion (tree); extern bool tree_ssa_useless_type_conversion (tree);
......
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