------- Additional Comments From pinskia at gcc dot gnu dot org  2005-02-02 
20:41 -------
My "fix" was not always correct.  Here is a fix which is more correct and works 
for this testcase also:
Index: tree-ssa-dse.c
===============================================================
====
RCS file: /cvs/gcc/gcc/gcc/tree-ssa-dse.c,v
retrieving revision 2.15
diff -u -p -r2.15 tree-ssa-dse.c
--- tree-ssa-dse.c      18 Jan 2005 11:36:26 -0000      2.15
+++ tree-ssa-dse.c      2 Feb 2005 20:36:48 -0000
@@ -134,6 +134,15 @@ fix_phi_uses (tree phi, tree stmt)
   def_operand_p def_p;
   ssa_op_iter iter;
   int i;
+  edge e;
+  edge_iterator ei;
+  bool abormal_phi;
+  
+  FOR_EACH_EDGE (e, ei, PHI_BB (phi)->preds) 
+  if (e->flags & EDGE_ABNORMAL)
+    break;
+  
+  abormal_phi = e != NULL;
 
   get_stmt_operands (stmt);
 
@@ -146,7 +155,10 @@ fix_phi_uses (tree phi, tree stmt)
         them with the appropriate V_MAY_DEF_OP.  */
       for (i = 0; i < PHI_NUM_ARGS (phi); i++)
        if (v_may_def == PHI_ARG_DEF (phi, i))
-         SET_PHI_ARG_DEF (phi, i, v_may_use);
+         {
+           SET_PHI_ARG_DEF (phi, i, v_may_use);
+           SSA_NAME_OCCURS_IN_ABNORMAL_PHI (v_may_use) = abormal_phi;
+         }
     }
 }
 


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19768

Reply via email to