Commit 65f4323d by Kazu Hirata Committed by Kazu Hirata

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
parent d48b4987
2004-11-04 Kazu Hirata <kazu@cs.umass.edu> 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 * cfghooks.c (delete_basic_block): Remove code to truncate
edge vectors. edge vectors.
......
...@@ -1954,15 +1954,16 @@ find_taken_edge (basic_block bb, tree val) ...@@ -1954,15 +1954,16 @@ find_taken_edge (basic_block bb, tree val)
gcc_assert (stmt); gcc_assert (stmt);
gcc_assert (is_ctrl_stmt (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 /* If VAL is a predicate of the form N RELOP N, where N is an
SSA_NAME, we can usually determine its truth value. */ SSA_NAME, we can usually determine its truth value. */
if (val && COMPARISON_CLASS_P (val)) if (COMPARISON_CLASS_P (val))
val = fold (val); val = fold (val);
/* If VAL is not a constant, we can't determine which edge might /* If VAL is not a constant, we can't determine which edge might
be taken. */ be taken. */
if (val == NULL || !really_constant_p (val)) if (!really_constant_p (val))
return NULL; return NULL;
if (TREE_CODE (stmt) == COND_EXPR) if (TREE_CODE (stmt) == COND_EXPR)
......
...@@ -1123,7 +1123,7 @@ visit_cond_stmt (tree stmt, edge *taken_edge_p) ...@@ -1123,7 +1123,7 @@ visit_cond_stmt (tree stmt, edge *taken_edge_p)
to the worklist. If no single edge can be determined statically, to the worklist. If no single edge can be determined statically,
return SSA_PROP_VARYING to feed all the outgoing edges to the return SSA_PROP_VARYING to feed all the outgoing edges to the
propagation engine. */ 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) if (*taken_edge_p)
return SSA_PROP_INTERESTING; return SSA_PROP_INTERESTING;
else else
......
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