diff options
author | kazu <kazu@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-12-20 14:47:07 +0000 |
---|---|---|
committer | kazu <kazu@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-12-20 14:47:07 +0000 |
commit | f9ead664f2dba52bcc3f977d8cadf01de99feb39 (patch) | |
tree | f4ca00ba23ba711cd266b66efd44af31919b3ed3 /gcc/tree-cfgcleanup.c | |
parent | cfb9bad3d7052c8e9a6fe67d63b099f8088c5adb (diff) | |
download | gcc-f9ead664f2dba52bcc3f977d8cadf01de99feb39.tar.gz |
gcc/
PR tree-optimization/25501
* tree-cfgcleanup.c (merge_phi_nodes): Check that RESULT is
used in the PHI argument corresponding to the edge from BB to
DEST.
gcc/testsuite/
PR tree-optimization/25501
* testsuite/gcc.dg/tree-ssa/pr25501.c: New.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@108853 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-cfgcleanup.c')
-rw-r--r-- | gcc/tree-cfgcleanup.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/gcc/tree-cfgcleanup.c b/gcc/tree-cfgcleanup.c index 6f8b1c05ad3..836a14d7772 100644 --- a/gcc/tree-cfgcleanup.c +++ b/gcc/tree-cfgcleanup.c @@ -746,6 +746,7 @@ merge_phi_nodes (void) else { tree phi; + unsigned int dest_idx = single_succ_edge (bb)->dest_idx; /* BB dominates DEST. There may be many users of the PHI nodes in BB. However, there is still a trivial case we @@ -767,7 +768,8 @@ merge_phi_nodes (void) /* Get the single use of the result of this PHI node. */ if (!single_imm_use (result, &imm_use, &use_stmt) || TREE_CODE (use_stmt) != PHI_NODE - || bb_for_stmt (use_stmt) != dest) + || bb_for_stmt (use_stmt) != dest + || PHI_ARG_DEF (use_stmt, dest_idx) != result) break; } |