Commit 68c834d0 by Richard Biener

tree-ssa-forwprop.c (forward_propagate_into_cond): Return 2 if we need to schedule cfg_cleanup.

2007-06-06  Richard Guenther  <rguenther@suse.de>

	* tree-ssa-forwprop.c (forward_propagate_into_cond): Return 2
	if we need to schedule cfg_cleanup.
	(tree_ssa_forward_propagate_single_use_vars): Do so.

From-SVN: r125490
parent 5a59ef36
2007-06-06 Richard Guenther <rguenther@suse.de>
* tree-ssa-forwprop.c (forward_propagate_into_cond): Return 2
if we need to schedule cfg_cleanup.
(tree_ssa_forward_propagate_single_use_vars): Do so.
2007-06-06 Ian Lance Taylor <iant@google.com> 2007-06-06 Ian Lance Taylor <iant@google.com>
* fold-const.c (merge_ranges): If range_successor or * fold-const.c (merge_ranges): If range_successor or
...@@ -247,7 +253,7 @@ ...@@ -247,7 +253,7 @@
PR target/31733 PR target/31733
* cfgrtl.c (rtl_verify_flow_info): Skip notes when looking for barrier. * cfgrtl.c (rtl_verify_flow_info): Skip notes when looking for barrier.
2007-05-31 Jan Hubicka <jh@suse.cz> 2007-06-04 Jan Hubicka <jh@suse.cz>
* tree-predcom.c (replace_ref_with, initialize_root_vars_lm, * tree-predcom.c (replace_ref_with, initialize_root_vars_lm,
reassociate_to_the_same_stmt): Call build_gimple_modify_stmt reassociate_to_the_same_stmt): Call build_gimple_modify_stmt
......
...@@ -370,12 +370,14 @@ combine_cond_expr_cond (enum tree_code code, tree type, ...@@ -370,12 +370,14 @@ combine_cond_expr_cond (enum tree_code code, tree type,
} }
/* Propagate from the ssa name definition statements of COND_EXPR /* Propagate from the ssa name definition statements of COND_EXPR
in statement STMT into the conditional if that simplifies it. */ in statement STMT into the conditional if that simplifies it.
Returns zero if no statement was changed, one if there were
changes and two if cfg_cleanup needs to run. */
static bool static int
forward_propagate_into_cond (tree cond_expr, tree stmt) forward_propagate_into_cond (tree cond_expr, tree stmt)
{ {
bool did_something = false; int did_something = 0;
do { do {
tree tmp = NULL_TREE; tree tmp = NULL_TREE;
...@@ -449,7 +451,10 @@ forward_propagate_into_cond (tree cond_expr, tree stmt) ...@@ -449,7 +451,10 @@ forward_propagate_into_cond (tree cond_expr, tree stmt)
/* Remove defining statements. */ /* Remove defining statements. */
remove_prop_source_from_use (name, NULL); remove_prop_source_from_use (name, NULL);
did_something = true; if (is_gimple_min_invariant (tmp))
did_something = 2;
else if (did_something == 0)
did_something = 1;
/* Continue combining. */ /* Continue combining. */
continue; continue;
...@@ -1014,9 +1019,11 @@ tree_ssa_forward_propagate_single_use_vars (void) ...@@ -1014,9 +1019,11 @@ tree_ssa_forward_propagate_single_use_vars (void)
} }
else if (TREE_CODE (rhs) == COND_EXPR) else if (TREE_CODE (rhs) == COND_EXPR)
{ {
bool did_something; int did_something;
fold_defer_overflow_warnings (); fold_defer_overflow_warnings ();
did_something = forward_propagate_into_cond (rhs, stmt); did_something = forward_propagate_into_cond (rhs, stmt);
if (did_something == 2)
cfg_changed = true;
fold_undefer_overflow_warnings (!TREE_NO_WARNING (rhs) fold_undefer_overflow_warnings (!TREE_NO_WARNING (rhs)
&& did_something, stmt, WARN_STRICT_OVERFLOW_CONDITIONAL); && did_something, stmt, WARN_STRICT_OVERFLOW_CONDITIONAL);
bsi_next (&bsi); bsi_next (&bsi);
...@@ -1042,9 +1049,11 @@ tree_ssa_forward_propagate_single_use_vars (void) ...@@ -1042,9 +1049,11 @@ tree_ssa_forward_propagate_single_use_vars (void)
} }
else if (TREE_CODE (stmt) == COND_EXPR) else if (TREE_CODE (stmt) == COND_EXPR)
{ {
bool did_something; int did_something;
fold_defer_overflow_warnings (); fold_defer_overflow_warnings ();
did_something = forward_propagate_into_cond (stmt, stmt); did_something = forward_propagate_into_cond (stmt, stmt);
if (did_something == 2)
cfg_changed = true;
fold_undefer_overflow_warnings (!TREE_NO_WARNING (stmt) fold_undefer_overflow_warnings (!TREE_NO_WARNING (stmt)
&& did_something, stmt, && did_something, stmt,
WARN_STRICT_OVERFLOW_CONDITIONAL); WARN_STRICT_OVERFLOW_CONDITIONAL);
......
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