Commit daa2b95a by Jeff Law Committed by Jeff Law

tree-ssa.c (kill_redundant_phi_nodes): More correctly handle PHIs where the…

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
parent d962e073
2004-06-14 Jeff Law <law@redhat.com>
* 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.
2004-06-14 Jakub Jelinek <jakub@redhat.com> 2004-06-14 Jakub Jelinek <jakub@redhat.com>
PR middle-end/15945 PR middle-end/15945
......
2004-06-14 Jeff Law <law@redhat.com>
* gcc.c-torture/compile/20040614-1.c: New test.
2004-06-14 Tobias Schlueter <tobias.schlueter@physik.uni-muenchen.de> 2004-06-14 Tobias Schlueter <tobias.schlueter@physik.uni-muenchen.de>
PR fortran/15211 PR fortran/15211
......
#ifndef NO_LABEL_VALUES
void f(int r1, int *fp)
{
void *hlbl_tbl[] = { &&label1 };
goto *hlbl_tbl[r1];
*fp = 0;
label0:
fp += 8;
label1:
*fp = 0;
if (r1)
goto label2;
if (r1)
goto label0;
label2:
;
}
#else
int x;
#endif
...@@ -885,6 +885,14 @@ kill_redundant_phi_nodes (void) ...@@ -885,6 +885,14 @@ kill_redundant_phi_nodes (void)
{ {
var = PHI_RESULT (phi); 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++) for (i = 0; i < (unsigned) PHI_NUM_ARGS (phi); i++)
{ {
t = PHI_ARG_DEF (phi, i); t = PHI_ARG_DEF (phi, i);
...@@ -897,12 +905,20 @@ kill_redundant_phi_nodes (void) ...@@ -897,12 +905,20 @@ kill_redundant_phi_nodes (void)
stmt = SSA_NAME_DEF_STMT (t); 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 /* If the defining statement for this argument is not a
phi node or the argument is associated with an abnormal phi node then we need to recursively start the forward
edge, then we need to recursively start the forward
dataflow starting with PHI. */ dataflow starting with PHI. */
if (TREE_CODE (stmt) != PHI_NODE if (TREE_CODE (stmt) != PHI_NODE)
|| SSA_NAME_OCCURS_IN_ABNORMAL_PHI (t))
{ {
eq_to[SSA_NAME_VERSION (t)] = t; eq_to[SSA_NAME_VERSION (t)] = t;
raise_value (phi, t, eq_to); raise_value (phi, t, eq_to);
......
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