OSDN Git Service

2009-10-15 Andrew Pinski <andrew_pinski@playstation.sony.com>
[pf3gnuchains/gcc-fork.git] / gcc / tree-ssa-loop-manip.c
index c4a40b0..bc5c339 100644 (file)
@@ -125,8 +125,8 @@ create_iv (tree base, tree step, tree var, struct loop *loop,
 
   stmt = create_phi_node (vb, loop->header);
   SSA_NAME_DEF_STMT (vb) = stmt;
-  add_phi_arg (stmt, initial, loop_preheader_edge (loop));
-  add_phi_arg (stmt, va, loop_latch_edge (loop));
+  add_phi_arg (stmt, initial, loop_preheader_edge (loop), UNKNOWN_LOCATION);
+  add_phi_arg (stmt, va, loop_latch_edge (loop), UNKNOWN_LOCATION);
 }
 
 /* Add exit phis for the USE on EXIT.  */
@@ -156,7 +156,7 @@ add_exit_phis_edge (basic_block exit, tree use)
   create_new_def_for (gimple_phi_result (phi), phi,
                      gimple_phi_result_ptr (phi));
   FOR_EACH_EDGE (e, ei, exit->preds)
-    add_phi_arg (phi, use, e);
+    add_phi_arg (phi, use, e, UNKNOWN_LOCATION);
 }
 
 /* Add exit phis for VAR that is used in LIVEIN.
@@ -279,6 +279,9 @@ find_uses_to_rename_stmt (gimple stmt, bitmap *use_blocks, bitmap need_phis)
   tree var;
   basic_block bb = gimple_bb (stmt);
 
+  if (is_gimple_debug (stmt))
+    return;
+
   FOR_EACH_SSA_TREE_OPERAND (var, stmt, iter, SSA_OP_ALL_USES)
     find_uses_to_rename_use (bb, var, use_blocks, need_phis);
 }
@@ -429,6 +432,9 @@ check_loop_closed_ssa_stmt (basic_block bb, gimple stmt)
   ssa_op_iter iter;
   tree var;
 
+  if (is_gimple_debug (stmt))
+    return;
+
   FOR_EACH_SSA_TREE_OPERAND (var, stmt, iter, SSA_OP_ALL_USES)
     check_loop_closed_ssa_use (bb, var);
 }
@@ -476,11 +482,13 @@ split_loop_exit_edge (edge exit)
   tree new_name, name;
   use_operand_p op_p;
   gimple_stmt_iterator psi;
+  source_location locus;
 
   for (psi = gsi_start_phis (dest); !gsi_end_p (psi); gsi_next (&psi))
     {
       phi = gsi_stmt (psi);
       op_p = PHI_ARG_DEF_PTR_FROM_EDGE (phi, single_succ_edge (bb));
+      locus = gimple_phi_arg_location_from_edge (phi, single_succ_edge (bb));
 
       name = USE_FROM_PTR (op_p);
 
@@ -494,7 +502,7 @@ split_loop_exit_edge (edge exit)
       new_name = duplicate_ssa_name (name, NULL);
       new_phi = create_phi_node (new_name, bb);
       SSA_NAME_DEF_STMT (new_name) = new_phi;
-      add_phi_arg (new_phi, name, exit);
+      add_phi_arg (new_phi, name, exit, locus);
       SET_USE (op_p, new_name);
     }
 
@@ -1014,8 +1022,8 @@ tree_transform_and_unroll_loop (struct loop *loop, unsigned factor,
       phi_rest = create_phi_node (new_init, rest);
       SSA_NAME_DEF_STMT (new_init) = phi_rest;
 
-      add_phi_arg (phi_rest, init, precond_edge);
-      add_phi_arg (phi_rest, next, new_exit);
+      add_phi_arg (phi_rest, init, precond_edge, UNKNOWN_LOCATION);
+      add_phi_arg (phi_rest, next, new_exit, UNKNOWN_LOCATION);
       SET_USE (op, new_init);
     }