Commit 224b4faf by Jeff Law Committed by Jeff Law

tree-ssa-uncprop.c (associate_equivalences_with_edges): Properly handle…

tree-ssa-uncprop.c (associate_equivalences_with_edges): Properly handle SSA_NAME_OCCURS_IN_ABNORMAL_PHI.

        * tree-ssa-uncprop.c (associate_equivalences_with_edges): Properly
        handle SSA_NAME_OCCURS_IN_ABNORMAL_PHI.

        * g++.old-deja/g++.law/pr25000.C: New test.

From-SVN: r107710
parent a488b14d
2005-11-30 Jeff Law <law@redhat.com>
* tree-ssa-uncprop.c (associate_equivalences_with_edges): Properly
handle SSA_NAME_OCCURS_IN_ABNORMAL_PHI.
2005-11-30 Jakub Jelinek <jakub@redhat.com> 2005-11-30 Jakub Jelinek <jakub@redhat.com>
* config/ia64/ia64.c (ia64_expand_tls_address): Add ORIG_OP1 argument. * config/ia64/ia64.c (ia64_expand_tls_address): Add ORIG_OP1 argument.
......
2005-11-30 Jeff Law <law@redhat.com>
* g++.old-deja/g++.law/pr25000.C: New test.
2005-11-30 Jakub Jelinek <jakub@redhat.com> 2005-11-30 Jakub Jelinek <jakub@redhat.com>
* gcc.dg/tls/opt-11.c: New test. * gcc.dg/tls/opt-11.c: New test.
// { dg-do compile }
// { dg-options "-O2" }
int * f(void);
void g(int*);
bool h(void);
void Find( )
{
int * pRes = f();
if( !pRes ) {
if( h()){
if( h()){
try
{
pRes = new int();
f();
}catch(int& e1 ){}
}
if( !pRes )
f();
}
g(pRes);
}
}
...@@ -92,7 +92,8 @@ associate_equivalences_with_edges (void) ...@@ -92,7 +92,8 @@ associate_equivalences_with_edges (void)
/* If the conditional is a single variable 'X', record 'X = 1' /* If the conditional is a single variable 'X', record 'X = 1'
for the true edge and 'X = 0' on the false edge. */ for the true edge and 'X = 0' on the false edge. */
if (TREE_CODE (cond) == SSA_NAME) if (TREE_CODE (cond) == SSA_NAME
&& !SSA_NAME_OCCURS_IN_ABNORMAL_PHI (cond))
{ {
equivalency = xmalloc (sizeof (struct edge_equivalency)); equivalency = xmalloc (sizeof (struct edge_equivalency));
equivalency->rhs = constant_boolean_node (1, TREE_TYPE (cond)); equivalency->rhs = constant_boolean_node (1, TREE_TYPE (cond));
...@@ -114,6 +115,7 @@ associate_equivalences_with_edges (void) ...@@ -114,6 +115,7 @@ associate_equivalences_with_edges (void)
know the value of OP0 on both arms of the branch. i.e., we know the value of OP0 on both arms of the branch. i.e., we
can record an equivalence for OP0 rather than COND. */ can record an equivalence for OP0 rather than COND. */
if (TREE_CODE (op0) == SSA_NAME if (TREE_CODE (op0) == SSA_NAME
&& !SSA_NAME_OCCURS_IN_ABNORMAL_PHI (op0)
&& TREE_CODE (TREE_TYPE (op0)) == BOOLEAN_TYPE && TREE_CODE (TREE_TYPE (op0)) == BOOLEAN_TYPE
&& is_gimple_min_invariant (op1)) && is_gimple_min_invariant (op1))
{ {
...@@ -152,8 +154,10 @@ associate_equivalences_with_edges (void) ...@@ -152,8 +154,10 @@ associate_equivalences_with_edges (void)
} }
if (TREE_CODE (op0) == SSA_NAME if (TREE_CODE (op0) == SSA_NAME
&& !SSA_NAME_OCCURS_IN_ABNORMAL_PHI (op0)
&& (is_gimple_min_invariant (op1) && (is_gimple_min_invariant (op1)
|| TREE_CODE (op1) == SSA_NAME)) || (TREE_CODE (op1) == SSA_NAME
&& !SSA_NAME_OCCURS_IN_ABNORMAL_PHI (op1))))
{ {
/* For IEEE, -0.0 == 0.0, so we don't necessarily know /* For IEEE, -0.0 == 0.0, so we don't necessarily know
the sign of a variable compared against zero. If the sign of a variable compared against zero. If
...@@ -185,7 +189,8 @@ associate_equivalences_with_edges (void) ...@@ -185,7 +189,8 @@ associate_equivalences_with_edges (void)
{ {
tree cond = SWITCH_COND (stmt); tree cond = SWITCH_COND (stmt);
if (TREE_CODE (cond) == SSA_NAME) if (TREE_CODE (cond) == SSA_NAME
&& !SSA_NAME_OCCURS_IN_ABNORMAL_PHI (cond))
{ {
tree labels = SWITCH_LABELS (stmt); tree labels = SWITCH_LABELS (stmt);
int i, n_labels = TREE_VEC_LENGTH (labels); int i, n_labels = TREE_VEC_LENGTH (labels);
......
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