This is the mail archive of the
mailing list for the GCC project.
[patch] tree-cfg.c: Make sure that EDGE_COUNT of COND_EXPR is two.
- From: Kazu Hirata <kazu at cs dot umass dot edu>
- To: gcc-patches at gcc dot gnu dot org
- Date: Wed, 03 Nov 2004 17:21:47 -0500 (EST)
- Subject: [patch] tree-cfg.c: Make sure that EDGE_COUNT of COND_EXPR is two.
Attached is a patch to have tree_verify_flow_info catch any COND_EXPR
with the number of its edges not being two.
Actually, just above this "if" stateemnt in the patch, we have a call
to extract_true_false_edges_from_block, which expects exactly two
edges, so we are very likely to crash there before we even get to the
"if" statement if we have less than two edges. In any case, it's good
to be exact.
Tested on i686-pc-linux-gnu. OK to apply?
2004-11-03 Kazu Hirata <firstname.lastname@example.org>
* tree-cfg.c (tree_verify_flow_info): Make sure that
EDGE_COUNT of COND_EXPR is two.
RCS file: /cvs/gcc/gcc/gcc/tree-cfg.c,v
retrieving revision 2.98
diff -u -d -p -r2.98 tree-cfg.c
--- tree-cfg.c 3 Nov 2004 01:40:56 -0000 2.98
+++ tree-cfg.c 3 Nov 2004 01:56:33 -0000
@@ -3492,7 +3492,7 @@ tree_verify_flow_info (void)
|| !(false_edge->flags & EDGE_FALSE_VALUE)
|| (true_edge->flags & (EDGE_FALLTHRU | EDGE_ABNORMAL))
|| (false_edge->flags & (EDGE_FALLTHRU | EDGE_ABNORMAL))
- || EDGE_COUNT (bb->succs) >= 3)
+ || EDGE_COUNT (bb->succs) != 2)
error ("Wrong outgoing edge flags at end of bb %d\n",