tree-cfg.c (find_taken_edge): Reject VAL begin NULL.

* tree-cfg.c (find_taken_edge): Reject VAL begin NULL.
	* tree-ssa-ccp.c (visit_cond_stmt): Don't call find_taken_edge
	with VAL being NULL.

From-SVN: r90083
This commit is contained in:
Kazu Hirata 2004-11-04 22:07:39 +00:00 committed by Kazu Hirata
parent d48b4987af
commit 65f4323d84
3 changed files with 10 additions and 3 deletions

View file

@ -1,3 +1,9 @@
2004-11-04 Kazu Hirata <kazu@cs.umass.edu>
* tree-cfg.c (find_taken_edge): Reject VAL begin NULL.
* tree-ssa-ccp.c (visit_cond_stmt): Don't call find_taken_edge
with VAL being NULL.
2004-11-04 Kazu Hirata <kazu@cs.umass.edu>
* cfghooks.c (delete_basic_block): Remove code to truncate

View file

@ -1954,15 +1954,16 @@ find_taken_edge (basic_block bb, tree val)
gcc_assert (stmt);
gcc_assert (is_ctrl_stmt (stmt));
gcc_assert (val);
/* If VAL is a predicate of the form N RELOP N, where N is an
SSA_NAME, we can usually determine its truth value. */
if (val && COMPARISON_CLASS_P (val))
if (COMPARISON_CLASS_P (val))
val = fold (val);
/* If VAL is not a constant, we can't determine which edge might
be taken. */
if (val == NULL || !really_constant_p (val))
if (!really_constant_p (val))
return NULL;
if (TREE_CODE (stmt) == COND_EXPR)

View file

@ -1123,7 +1123,7 @@ visit_cond_stmt (tree stmt, edge *taken_edge_p)
to the worklist. If no single edge can be determined statically,
return SSA_PROP_VARYING to feed all the outgoing edges to the
propagation engine. */
*taken_edge_p = find_taken_edge (block, val.const_val);
*taken_edge_p = val.const_val ? find_taken_edge (block, val.const_val) : 0;
if (*taken_edge_p)
return SSA_PROP_INTERESTING;
else