OSDN Git Service

2009-06-17 H.J. Lu <hongjiu.lu@intel.com>
[pf3gnuchains/gcc-fork.git] / gcc / tree-switch-conversion.c
index eade177..292c49c 100644 (file)
@@ -499,6 +499,7 @@ build_one_array (gimple swtch, int num, tree arr_index_type, gimple phi,
   tree name, cst;
   gimple load;
   gimple_stmt_iterator gsi = gsi_for_stmt (swtch);
+  location_t loc = gimple_location (swtch);
 
   gcc_assert (info.default_values[num]);
 
@@ -517,7 +518,7 @@ build_one_array (gimple swtch, int num, tree arr_index_type, gimple phi,
       ctor = build_constructor (array_type, info.constructors[num]);
       TREE_CONSTANT (ctor) = true;
 
-      decl = build_decl (VAR_DECL, NULL_TREE, array_type);
+      decl = build_decl (loc, VAR_DECL, NULL_TREE, array_type);
       TREE_STATIC (decl) = 1;
       DECL_INITIAL (decl) = ctor;
 
@@ -547,7 +548,7 @@ static void
 build_arrays (gimple swtch)
 {
   tree arr_index_type;
-  tree tidx, sub;
+  tree tidx, sub, tmp;
   gimple stmt;
   gimple_stmt_iterator gsi;
   int i;
@@ -555,7 +556,9 @@ build_arrays (gimple swtch)
   gsi = gsi_for_stmt (swtch);
 
   arr_index_type = build_index_type (info.range_size);
-  tidx = make_ssa_name (create_tmp_var (arr_index_type, "csti"), NULL);
+  tmp = create_tmp_var (arr_index_type, "csti");
+  add_referenced_var (tmp);
+  tidx = make_ssa_name (tmp, NULL);
   sub = fold_build2 (MINUS_EXPR, TREE_TYPE (info.index_expr), info.index_expr,
                     fold_convert (TREE_TYPE (info.index_expr),
                                   info.range_min));
@@ -663,9 +666,9 @@ fix_phi_nodes (edge e1f, edge e2f, basic_block bbf)
 static void
 gen_inbound_check (gimple swtch)
 {
-  tree label_decl1 = create_artificial_label ();
-  tree label_decl2 = create_artificial_label ();
-  tree label_decl3 = create_artificial_label ();
+  tree label_decl1 = create_artificial_label (UNKNOWN_LOCATION);
+  tree label_decl2 = create_artificial_label (UNKNOWN_LOCATION);
+  tree label_decl3 = create_artificial_label (UNKNOWN_LOCATION);
   gimple label1, label2, label3;
 
   tree utype;
@@ -694,6 +697,7 @@ gen_inbound_check (gimple swtch)
   /* (end of) block 0 */
   gsi = gsi_for_stmt (info.arr_ref_first);
   tmp_u_var = create_tmp_var (utype, "csui");
+  add_referenced_var (tmp_u_var);
   tmp_u_1 = make_ssa_name (tmp_u_var, NULL);
 
   cast = fold_convert (utype, info.index_expr);