+2005-02-03 Andrew Pinski <pinskia@physics.uc.edu>
+
+ PR tree-opt/19768
+ * tree-ssa-dse.c (fix_phi_uses): Update the occurs in abnormal
+ phi flag if the phi is abnormal.
+
2005-02-03 Andrew Pinski <pinskia@physics.uc.edu>
PR tree-opt/19736
--- /dev/null
+// PR tree-opt/19768
+// tree DSE was removing one store to LL.currentLevel
+// but forgot that since the vop was in an abnormal PHI
+// that we have to update the SSA_NAME which we propagate
+// into the abnormal PHI
+
+// { dg-do compile }
+// { dg-options "-O" }
+
+struct LeveLogger
+{
+ int currentLevel;
+};
+extern LeveLogger LL;
+struct gg
+{
+ ~gg ( void )
+ { LL.currentLevel = 1; }
+};
+void f(void);
+void g ( void )
+{
+ gg sll;
+ {
+ gg sll;
+ f();
+ }
+ f();
+}
def_operand_p def_p;
ssa_op_iter iter;
int i;
-
+ edge e;
+ edge_iterator ei;
+
+ FOR_EACH_EDGE (e, ei, PHI_BB (phi)->preds)
+ if (e->flags & EDGE_ABNORMAL)
+ break;
+
get_stmt_operands (stmt);
FOR_EACH_SSA_MAYDEF_OPERAND (def_p, use_p, stmt, iter)
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);
+ /* Update if the new phi argument is an abnormal phi. */
+ if (e != NULL)
+ SSA_NAME_OCCURS_IN_ABNORMAL_PHI (v_may_use) = 1;
+ }
}
}