OSDN Git Service

* config/rs6000/rs6000.c (build_opaque_vector_type): Set
[pf3gnuchains/gcc-fork.git] / gcc / tree-cfg.c
index ed52826..3034ba3 100644 (file)
@@ -114,26 +114,41 @@ static edge find_taken_edge_switch_expr (basic_block, tree);
 static tree find_case_label_for_value (tree, tree);
 
 void
-init_empty_tree_cfg (void)
+init_empty_tree_cfg_for_function (struct function *fn)
 {
   /* Initialize the basic block array.  */
-  init_flow ();
-  profile_status = PROFILE_ABSENT;
-  n_basic_blocks = NUM_FIXED_BLOCKS;
-  last_basic_block = NUM_FIXED_BLOCKS;
-  basic_block_info = VEC_alloc (basic_block, gc, initial_cfg_capacity);
-  VEC_safe_grow_cleared (basic_block, gc, basic_block_info,
+  init_flow (fn);
+  profile_status_for_function (fn) = PROFILE_ABSENT;
+  n_basic_blocks_for_function (fn) = NUM_FIXED_BLOCKS;
+  last_basic_block_for_function (fn) = NUM_FIXED_BLOCKS;
+  basic_block_info_for_function (fn)
+    = VEC_alloc (basic_block, gc, initial_cfg_capacity);
+  VEC_safe_grow_cleared (basic_block, gc,
+                        basic_block_info_for_function (fn),
                         initial_cfg_capacity);
 
   /* Build a mapping of labels to their associated blocks.  */
-  label_to_block_map = VEC_alloc (basic_block, gc, initial_cfg_capacity);
-  VEC_safe_grow_cleared (basic_block, gc, label_to_block_map,
+  label_to_block_map_for_function (fn)
+    = VEC_alloc (basic_block, gc, initial_cfg_capacity);
+  VEC_safe_grow_cleared (basic_block, gc,
+                        label_to_block_map_for_function (fn),
                         initial_cfg_capacity);
 
-  SET_BASIC_BLOCK (ENTRY_BLOCK, ENTRY_BLOCK_PTR);
-  SET_BASIC_BLOCK (EXIT_BLOCK, EXIT_BLOCK_PTR);
-  ENTRY_BLOCK_PTR->next_bb = EXIT_BLOCK_PTR;
-  EXIT_BLOCK_PTR->prev_bb = ENTRY_BLOCK_PTR;
+  SET_BASIC_BLOCK_FOR_FUNCTION (fn, ENTRY_BLOCK, 
+                               ENTRY_BLOCK_PTR_FOR_FUNCTION (fn));
+  SET_BASIC_BLOCK_FOR_FUNCTION (fn, EXIT_BLOCK, 
+                  EXIT_BLOCK_PTR_FOR_FUNCTION (fn));
+
+  ENTRY_BLOCK_PTR_FOR_FUNCTION (fn)->next_bb
+    = EXIT_BLOCK_PTR_FOR_FUNCTION (fn);
+  EXIT_BLOCK_PTR_FOR_FUNCTION (fn)->prev_bb
+    = ENTRY_BLOCK_PTR_FOR_FUNCTION (fn);
+}
+
+void
+init_empty_tree_cfg (void)
+{
+  init_empty_tree_cfg_for_function (cfun);
 }
 
 /*---------------------------------------------------------------------------
@@ -508,6 +523,7 @@ make_edges (void)
              break;
 
            case OMP_PARALLEL:
+           case OMP_TASK:
            case OMP_FOR:
            case OMP_SINGLE:
            case OMP_MASTER:
@@ -1921,16 +1937,17 @@ remove_useless_stmts_1 (tree *tp, struct rus_data *data)
       break;
 
     case OMP_PARALLEL:
+    case OMP_TASK:
       /* Make sure the outermost BIND_EXPR in OMP_BODY isn't removed
         as useless.  */
-      remove_useless_stmts_1 (&BIND_EXPR_BODY (OMP_BODY (*tp)), data);
+      remove_useless_stmts_1 (&BIND_EXPR_BODY (OMP_TASKREG_BODY (*tp)), data);
       data->last_goto = NULL;
       break;
 
     case OMP_SECTIONS:
     case OMP_SINGLE:
     case OMP_SECTION:
-    case OMP_MASTER :
+    case OMP_MASTER:
     case OMP_ORDERED:
     case OMP_CRITICAL:
       remove_useless_stmts_1 (&OMP_BODY (*tp), data);
@@ -3643,7 +3660,10 @@ verify_gimple_expr (tree expr)
           there is no sign or zero extension involved.  */
        if (((POINTER_TYPE_P (type) && INTEGRAL_TYPE_P (TREE_TYPE (op)))
             || (POINTER_TYPE_P (TREE_TYPE (op)) && INTEGRAL_TYPE_P (type)))
-           && TYPE_PRECISION (type) == TYPE_PRECISION (TREE_TYPE (op)))
+           && (TYPE_PRECISION (type) == TYPE_PRECISION (TREE_TYPE (op))
+               /* For targets were the precision of sizetype doesn't
+                  match that of pointers we need the following.  */
+               || type == sizetype || TREE_TYPE (op) == sizetype))
          return false;
 
        /* Allow conversion from integer to offset type and vice versa.  */
@@ -6179,12 +6199,17 @@ dump_function_to_file (tree fn, FILE *file, int flags)
       print_generic_expr (file, TREE_TYPE (arg), dump_flags);
       fprintf (file, " ");
       print_generic_expr (file, arg, dump_flags);
+      if (flags & TDF_VERBOSE)
+       print_node (file, "", arg, 4);
       if (TREE_CHAIN (arg))
        fprintf (file, ", ");
       arg = TREE_CHAIN (arg);
     }
   fprintf (file, ")\n");
 
+  if (flags & TDF_VERBOSE)
+    print_node (file, "", fn, 2);
+
   dsf = DECL_STRUCT_FUNCTION (fn);
   if (dsf && (flags & TDF_DETAILS))
     dump_eh_tree (file, dsf);
@@ -6210,6 +6235,8 @@ dump_function_to_file (tree fn, FILE *file, int flags)
          var = TREE_VALUE (vars);
 
          print_generic_decl (file, var, flags);
+         if (flags & TDF_VERBOSE)
+           print_node (file, "", var, 4);
          fprintf (file, "\n");
 
          any_var = true;