diff options
author | Kazu Hirata <kazu@cs.umass.edu> | 2004-12-02 16:43:33 +0000 |
---|---|---|
committer | Kazu Hirata <kazu@gcc.gnu.org> | 2004-12-02 16:43:33 +0000 |
commit | 5dd8841aa17a47ea6e0e6470e25de1e2ea40a99b (patch) | |
tree | 4264c08c2e3e8821d6002f0dab71bd15d70f6cb0 /gcc/tree-cfg.c | |
parent | ea7b59ba6966af16b8b026b501e9941c54c7346a (diff) | |
download | gcc-5dd8841aa17a47ea6e0e6470e25de1e2ea40a99b.zip gcc-5dd8841aa17a47ea6e0e6470e25de1e2ea40a99b.tar.gz gcc-5dd8841aa17a47ea6e0e6470e25de1e2ea40a99b.tar.bz2 |
tree-cfg.c (phi_alternatives_equal): Check that PHI_ARG_DEF is not null.
* tree-cfg.c (phi_alternatives_equal): Check that PHI_ARG_DEF
is not null.
From-SVN: r91646
Diffstat (limited to 'gcc/tree-cfg.c')
-rw-r--r-- | gcc/tree-cfg.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c index 93ce053..8af27b9 100644 --- a/gcc/tree-cfg.c +++ b/gcc/tree-cfg.c @@ -2264,19 +2264,17 @@ find_case_label_for_value (tree switch_expr, tree val) static bool phi_alternatives_equal (basic_block dest, edge e1, edge e2) { - tree phi, val1, val2; - int n1, n2; + int n1 = e1->dest_idx; + int n2 = e2->dest_idx; + tree phi; for (phi = phi_nodes (dest); phi; phi = PHI_CHAIN (phi)) { - n1 = phi_arg_from_edge (phi, e1); - n2 = phi_arg_from_edge (phi, e2); - - gcc_assert (n1 >= 0); - gcc_assert (n2 >= 0); + tree val1 = PHI_ARG_DEF (phi, n1); + tree val2 = PHI_ARG_DEF (phi, n2); - val1 = PHI_ARG_DEF (phi, n1); - val2 = PHI_ARG_DEF (phi, n2); + gcc_assert (val1 != NULL_TREE); + gcc_assert (val2 != NULL_TREE); if (!operand_equal_for_phi_arg_p (val1, val2)) return false; |