OSDN Git Service

Fix nit
[pf3gnuchains/gcc-fork.git] / gcc / tree-ssa-phiprop.c
index 6ccc30e..fcd1d23 100644 (file)
@@ -159,14 +159,17 @@ phiprop_insert_phi (basic_block bb, gimple phi, gimple use_stmt,
     {
       tree old_arg, new_var;
       gimple tmp;
+      source_location locus;
 
       old_arg = PHI_ARG_DEF_FROM_EDGE (phi, e);
+      locus = gimple_phi_arg_location_from_edge (phi, e);
       while (TREE_CODE (old_arg) == SSA_NAME
             && (SSA_NAME_VERSION (old_arg) >= n
                 || phivn[SSA_NAME_VERSION (old_arg)].value == NULL_TREE))
        {
          gimple def_stmt = SSA_NAME_DEF_STMT (old_arg);
          old_arg = gimple_assign_rhs1 (def_stmt);
+         locus = gimple_location (def_stmt);
        }
 
       if (TREE_CODE (old_arg) == SSA_NAME)
@@ -196,6 +199,7 @@ phiprop_insert_phi (basic_block bb, gimple phi, gimple use_stmt,
          add_referenced_var (new_var);
          new_var = make_ssa_name (new_var, tmp);
          gimple_assign_set_lhs (tmp, new_var);
+         gimple_set_location (tmp, locus);
 
          gsi_insert_on_edge (e, tmp);
          update_stmt (tmp);
@@ -209,7 +213,7 @@ phiprop_insert_phi (basic_block bb, gimple phi, gimple use_stmt,
            }
        }
 
-      add_phi_arg (new_phi, new_var, e);
+      add_phi_arg (new_phi, new_var, e, locus);
     }
 
   update_stmt (new_phi);
@@ -294,7 +298,7 @@ propagate_with_phi (basic_block bb, gimple phi, struct phiprop_d *phivn,
 
       /* Check whether this is a load of *ptr.  */
       if (!(is_gimple_assign (use_stmt)
-           && TREE_CODE (gimple_assign_lhs (use_stmt)) == SSA_NAME 
+           && TREE_CODE (gimple_assign_lhs (use_stmt)) == SSA_NAME
            && gimple_assign_rhs_code (use_stmt) == INDIRECT_REF
            && TREE_OPERAND (gimple_assign_rhs1 (use_stmt), 0) == ptr
            /* We cannot replace a load that may throw or is volatile.  */
@@ -351,7 +355,7 @@ tree_ssa_phiprop (void)
 {
   VEC(basic_block, heap) *bbs;
   struct phiprop_d *phivn;
-  bool did_something = false; 
+  bool did_something = false;
   basic_block bb;
   gimple_stmt_iterator gsi;
   unsigned i;
@@ -381,10 +385,10 @@ tree_ssa_phiprop (void)
 static bool
 gate_phiprop (void)
 {
-  return 1;
+  return flag_tree_phiprop;
 }
 
-struct gimple_opt_pass pass_phiprop = 
+struct gimple_opt_pass pass_phiprop =
 {
  {
   GIMPLE_PASS,