OSDN Git Service

2010-09-02 Ryan Mansfield <rmansfield@qnx.com>
[pf3gnuchains/gcc-fork.git] / gcc / tree-phinodes.c
index a48ae01..7fb85d4 100644 (file)
@@ -22,11 +22,11 @@ along with GCC; see the file COPYING3.  If not see
 #include "coretypes.h"
 #include "tm.h"
 #include "tree.h"
-#include "rtl.h"
-#include "varray.h"
+#include "rtl.h"       /* FIXME: Only for ceil_log2, of all things...  */
 #include "ggc.h"
 #include "basic-block.h"
 #include "tree-flow.h"
+#include "diagnostic-core.h"
 #include "toplev.h"
 #include "gimple.h"
 
@@ -154,7 +154,7 @@ allocate_phi_node (size_t len)
     }
   else
     {
-      phi = (gimple) ggc_alloc (size);
+      phi = ggc_alloc_gimple_statement_d (size);
 #ifdef GATHER_STATISTICS
       phi_nodes_created++;
        {
@@ -353,7 +353,7 @@ reserve_phi_args_for_new_edge (basic_block bb)
 
 /* Adds PHI to BB.  */
 
-void 
+void
 add_phi_node_to_bb (gimple phi, basic_block bb)
 {
   gimple_stmt_iterator gsi;
@@ -441,7 +441,7 @@ remove_phi_arg_num (gimple phi, int i)
       *(new_p->use) = *(old_p->use);
       relink_imm_use (new_p, old_p);
       /* Move the location as well.  */
-      gimple_phi_arg_set_location (phi, i, 
+      gimple_phi_arg_set_location (phi, i,
                                   gimple_phi_arg_location (phi, num_elem - 1));
     }
 
@@ -473,6 +473,10 @@ void
 remove_phi_node (gimple_stmt_iterator *gsi, bool release_lhs_p)
 {
   gimple phi = gsi_stmt (*gsi);
+
+  if (release_lhs_p)
+    insert_debug_temps_for_defs (gsi);
+
   gsi_remove (gsi, false);
 
   /* If we are deleting the PHI node, then we should release the