OSDN Git Service

PR c++/15815
[pf3gnuchains/gcc-fork.git] / gcc / tree-ssa-dce.c
index 36007a4..e9ead5c 100644 (file)
@@ -432,7 +432,7 @@ find_obviously_necessary_stmts (struct edge_list *el)
       tree phi;
 
       /* Check any PHI nodes in the block.  */
-      for (phi = phi_nodes (bb); phi; phi = TREE_CHAIN (phi))
+      for (phi = phi_nodes (bb); phi; phi = PHI_CHAIN (phi))
        {
          NECESSARY (phi) = 0;
 
@@ -500,7 +500,7 @@ mark_control_dependent_edges_necessary (basic_block bb, struct edge_list *el)
       SET_BIT (last_stmt_necessary, cd_bb->index);
 
       t = last_stmt (cd_bb);
-      if (is_ctrl_stmt (t))
+      if (t && is_ctrl_stmt (t))
        mark_stmt_necessary (t, true);
     });
 }
@@ -664,7 +664,7 @@ remove_dead_phis (basic_block bb)
 
       if (! NECESSARY (phi))
        {
-         tree next = TREE_CHAIN (phi);
+         tree next = PHI_CHAIN (phi);
 
          if (dump_file && (dump_flags & TDF_DETAILS))
            {
@@ -680,7 +680,7 @@ remove_dead_phis (basic_block bb)
       else
        {
          prev = phi;
-         phi = TREE_CHAIN (phi);
+         phi = PHI_CHAIN (phi);
        }
     }
 }