]> gcc.gnu.org Git - gcc.git/commitdiff
re PR tree-optimization/19768 (ICE: SSA_NAME_OCCURS_IN_ABNORMAL_PHI should be set)
authorAndrew Pinski <pinskia@physics.uc.edu>
Thu, 3 Feb 2005 15:26:29 +0000 (15:26 +0000)
committerAndrew Pinski <pinskia@gcc.gnu.org>
Thu, 3 Feb 2005 15:26:29 +0000 (07:26 -0800)
2005-02-03  Andrew Pinski  <pinskia@physics.uc.edu>

        PR tree-opt/19768
        * g++.dg/opt/pr19768.C: New test.

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.

From-SVN: r94660

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/opt/pr19768.C [new file with mode: 0644]
gcc/tree-ssa-dse.c

index b0561fd03c8b94563f19138f14f52461051d8760..c7b41ad29ef1a3c6750256989e905ac3dbd5e4d1 100644 (file)
@@ -1,3 +1,9 @@
+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
index 32e8ecbefd903afe64ea1fdfb2e9932154fe5b94..608b077b2337b75595cb4b18fedb17fcc7409072 100644 (file)
@@ -1,3 +1,8 @@
+2005-02-03  Andrew Pinski  <pinskia@physics.uc.edu>
+
+       PR tree-opt/19768
+       * g++.dg/opt/pr19768.C: New test.
+
 2005-02-03  Andrew Pinski  <pinskia@physics.uc.edu>
 
        PR tree-opt/19736
diff --git a/gcc/testsuite/g++.dg/opt/pr19768.C b/gcc/testsuite/g++.dg/opt/pr19768.C
new file mode 100644 (file)
index 0000000..376ca99
--- /dev/null
@@ -0,0 +1,29 @@
+//  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();
+}
index 5d29e03a70dc6bc621dd7af1bb4f34cf3579e6cd..625e1d1fa8fbc50395233430c28db83e80f7f6ac 100644 (file)
@@ -134,7 +134,13 @@ fix_phi_uses (tree phi, tree stmt)
   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)
@@ -146,7 +152,12 @@ 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);
+           /* Update if the new phi argument is an abnormal phi.  */
+           if (e != NULL)
+             SSA_NAME_OCCURS_IN_ABNORMAL_PHI (v_may_use) = 1;
+         }
     }
 }
 
This page took 0.079462 seconds and 5 git commands to generate.