OSDN Git Service

* cppfiles.c (open_file): Correct typo.
[pf3gnuchains/gcc-fork.git] / gcc / tree-ssa.c
index e7cd4a1..9c9206d 100644 (file)
@@ -538,6 +538,51 @@ verify_call_clobbering (void)
     internal_error ("verify_call_clobbering failed");
 }
 
+
+/* Verify invariants in memory partitions.  */
+
+static void
+verify_memory_partitions (void)
+{
+  unsigned i;
+  tree mpt;
+  VEC(tree,heap) *mpt_table = gimple_ssa_operands (cfun)->mpt_table;
+  struct pointer_set_t *partitioned_syms = pointer_set_create ();
+
+  for (i = 0; VEC_iterate (tree, mpt_table, i, mpt); i++)
+    {
+      unsigned j;
+      bitmap_iterator bj;
+
+      if (MPT_SYMBOLS (mpt) == NULL)
+       {
+         error ("Memory partitions should have at least one symbol");
+         debug_variable (mpt);
+         goto err;
+       }
+
+      EXECUTE_IF_SET_IN_BITMAP (MPT_SYMBOLS (mpt), 0, j, bj)
+       {
+         tree var = referenced_var (j);
+         if (pointer_set_insert (partitioned_syms, var))
+           {
+             error ("Partitioned symbols should belong to exactly one "
+                    "partition");
+             debug_variable (var);
+             goto err;
+           }
+       }
+    }
+
+  pointer_set_destroy (partitioned_syms);
+
+  return;
+
+err:
+  internal_error ("verify_memory_partitions failed");
+}
+
+
 /* Verify the consistency of aliasing information.  */
 
 static void
@@ -546,6 +591,7 @@ verify_alias_info (void)
   verify_flow_sensitive_alias_info ();
   verify_call_clobbering ();
   verify_flow_insensitive_alias_info ();
+  verify_memory_partitions ();
 }
 
 
@@ -560,7 +606,7 @@ verify_ssa (bool check_modified_stmt)
   basic_block *definition_block = XCNEWVEC (basic_block, num_ssa_names);
   ssa_op_iter iter;
   tree op;
-  enum dom_state orig_dom_state = dom_computed[CDI_DOMINATORS];
+  enum dom_state orig_dom_state = dom_info_state (CDI_DOMINATORS);
   bitmap names_defined_in_bb = BITMAP_ALLOC (NULL);
 
   gcc_assert (!need_ssa_update_p ());
@@ -701,7 +747,7 @@ verify_ssa (bool check_modified_stmt)
   if (orig_dom_state == DOM_NONE)
     free_dominance_info (CDI_DOMINATORS);
   else
-    dom_computed[CDI_DOMINATORS] = orig_dom_state;
+    set_dom_info_availability (CDI_DOMINATORS, orig_dom_state);
   
   BITMAP_FREE (names_defined_in_bb);
   timevar_pop (TV_TREE_SSA_VERIFY);
@@ -753,7 +799,7 @@ var_ann_hash (const void *item)
 void
 init_tree_ssa (void)
 {
-  cfun->gimple_df = ggc_alloc_cleared (sizeof (struct gimple_df));
+  cfun->gimple_df = GGC_CNEW (struct gimple_df);
   cfun->gimple_df->referenced_vars = htab_create_ggc (20, int_tree_map_hash, 
                                                      int_tree_map_eq, NULL);
   cfun->gimple_df->default_defs = htab_create_ggc (20, int_tree_map_hash, 
@@ -835,6 +881,7 @@ delete_tree_ssa (void)
       gcc_assert (!need_ssa_update_p ());
     }
   cfun->gimple_df->aliases_computed_p = false;
+  delete_mem_ref_stats (cfun);
 
   cfun->gimple_df = NULL;
 }
@@ -902,13 +949,15 @@ tree_ssa_useless_type_conversion_1 (tree outer_type, tree inner_type)
   else if (INTEGRAL_TYPE_P (inner_type)
            && INTEGRAL_TYPE_P (outer_type)
           && TYPE_UNSIGNED (inner_type) == TYPE_UNSIGNED (outer_type)
-          && TYPE_PRECISION (inner_type) == TYPE_PRECISION (outer_type)
-          && simple_cst_equal (TYPE_MAX_VALUE (inner_type), TYPE_MAX_VALUE (outer_type))
-          && simple_cst_equal (TYPE_MIN_VALUE (inner_type), TYPE_MIN_VALUE (outer_type)))
+          && TYPE_PRECISION (inner_type) == TYPE_PRECISION (outer_type))
     {
+      tree min_inner = fold_convert (outer_type, TYPE_MIN_VALUE (inner_type));
+      tree max_inner = fold_convert (outer_type, TYPE_MAX_VALUE (inner_type));
       bool first_boolean = (TREE_CODE (inner_type) == BOOLEAN_TYPE);
       bool second_boolean = (TREE_CODE (outer_type) == BOOLEAN_TYPE);
-      if (first_boolean == second_boolean)
+      if (simple_cst_equal (max_inner, TYPE_MAX_VALUE (outer_type))
+         && simple_cst_equal (min_inner, TYPE_MIN_VALUE (outer_type))
+         && first_boolean == second_boolean)
        return true;
     }
 
@@ -1103,7 +1152,7 @@ warn_uninit (tree t, const char *gmsgid, void *data)
   locus = (context != NULL && EXPR_HAS_LOCATION (context)
           ? EXPR_LOCUS (context)
           : &DECL_SOURCE_LOCATION (var));
-  warning (0, gmsgid, locus, var);
+  warning (OPT_Wuninitialized, gmsgid, locus, var);
   xloc = expand_location (*locus);
   floc = expand_location (DECL_SOURCE_LOCATION (cfun->decl));
   if (xloc.file != floc.file