diff options
author | Jeff Law <law@redhat.com> | 2004-06-14 14:41:41 -0600 |
---|---|---|
committer | Jeff Law <law@gcc.gnu.org> | 2004-06-14 14:41:41 -0600 |
commit | daa2b95a4f0e16d75fe83a5d4a38d72c1bbce097 (patch) | |
tree | 2a6b012635368f8e3f24c906ad8fc525270e4b0b /gcc/tree-ssa.c | |
parent | d962e073a077fe4066b937412d0f6d435f2f4f92 (diff) | |
download | gcc-daa2b95a4f0e16d75fe83a5d4a38d72c1bbce097.zip gcc-daa2b95a4f0e16d75fe83a5d4a38d72c1bbce097.tar.gz gcc-daa2b95a4f0e16d75fe83a5d4a38d72c1bbce097.tar.bz2 |
tree-ssa.c (kill_redundant_phi_nodes): More correctly handle PHIs where the destination or an argument is marked with...
* tree-ssa.c (kill_redundant_phi_nodes): More correctly handle
PHIs where the destination or an argument is marked with
SSA_NAME_OCCURS_IN_ABNORMAL_PHI.
* gcc.c-torture/20040614-1.c: New test.
From-SVN: r83132
Diffstat (limited to 'gcc/tree-ssa.c')
-rw-r--r-- | gcc/tree-ssa.c | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/gcc/tree-ssa.c b/gcc/tree-ssa.c index d553676..9cec5d5 100644 --- a/gcc/tree-ssa.c +++ b/gcc/tree-ssa.c @@ -885,6 +885,14 @@ kill_redundant_phi_nodes (void) { var = PHI_RESULT (phi); + /* If the destination of the PHI is associated with an + abnormal edge, then we can not propagate this PHI away. */ + if (SSA_NAME_OCCURS_IN_ABNORMAL_PHI (var)) + { + raise_value (phi, var, eq_to); + continue; + } + for (i = 0; i < (unsigned) PHI_NUM_ARGS (phi); i++) { t = PHI_ARG_DEF (phi, i); @@ -897,12 +905,20 @@ kill_redundant_phi_nodes (void) stmt = SSA_NAME_DEF_STMT (t); + /* If any particular PHI argument is associated with + an abnormal edge, then we know that we should not + be propagating away this PHI. Go ahead and raise + the result of this PHI to the top of the lattice. */ + if (SSA_NAME_OCCURS_IN_ABNORMAL_PHI (t)) + { + raise_value (phi, var, eq_to); + continue; + } + /* If the defining statement for this argument is not a - phi node or the argument is associated with an abnormal - edge, then we need to recursively start the forward + phi node then we need to recursively start the forward dataflow starting with PHI. */ - if (TREE_CODE (stmt) != PHI_NODE - || SSA_NAME_OCCURS_IN_ABNORMAL_PHI (t)) + if (TREE_CODE (stmt) != PHI_NODE) { eq_to[SSA_NAME_VERSION (t)] = t; raise_value (phi, t, eq_to); |