]> gcc.gnu.org Git - gcc.git/commitdiff
lto-symtab.c (lto_cgraph_replace_node): Use types_compatible_p for diagnostics.
authorRichard Guenther <rguenther@suse.de>
Mon, 9 May 2011 16:00:48 +0000 (16:00 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Mon, 9 May 2011 16:00:48 +0000 (16:00 +0000)
2011-05-09  Richard Guenther  <rguenther@suse.de>

* lto-symtab.c (lto_cgraph_replace_node): Use types_compatible_p
for diagnostics.
(lto_symtab_merge): Likewise.  Do not register types here.
(lto_symtab_merge_decls_2): Likewise.
(lto_symtab_merge_decls_1): Likewise.
* gimple.h (enum gtc_mode, gimple_types_compatible_p): Do not declare.
* gimple.c (enum gtc_mode): Declare.
(gimple_types_compatible_p): Make static.

From-SVN: r173575

gcc/ChangeLog
gcc/gimple.c
gcc/gimple.h
gcc/lto-symtab.c

index eac0d65377fa08a907f9166fcbbc53951948f716..1f63e237cee6202f33d97a83f416205e22ca5443 100644 (file)
@@ -1,3 +1,14 @@
+2011-05-09  Richard Guenther  <rguenther@suse.de>
+
+       * lto-symtab.c (lto_cgraph_replace_node): Use types_compatible_p
+       for diagnostics.
+       (lto_symtab_merge): Likewise.  Do not register types here.
+       (lto_symtab_merge_decls_2): Likewise.
+       (lto_symtab_merge_decls_1): Likewise.
+       * gimple.h (enum gtc_mode, gimple_types_compatible_p): Do not declare.
+       * gimple.c (enum gtc_mode): Declare.
+       (gimple_types_compatible_p): Make static.
+
 2011-05-09  Andreas Krebbel  <Andreas.Krebbel@de.ibm.com>
 
        * config/s390/s390.md (TD/TF mem to reg move splitter): Make the
index 385c098f4556f3a876ca5e47a6f21c81b58eff16..af866171b4f873068f84fbba49f8e2ee5ad32dda 100644 (file)
@@ -3208,6 +3208,8 @@ gimple_call_copy_skip_args (gimple stmt, bitmap args_to_skip)
 }
 
 
+enum gtc_mode { GTC_MERGE = 0, GTC_DIAG = 1 };
+
 static hashval_t gimple_type_hash_1 (const void *, enum gtc_mode);
 
 /* Structure used to maintain a cache of some type pairs compared by
@@ -3908,7 +3910,7 @@ pop:
    FOR_MERGING_P is true the an incomplete type and a complete type
    are considered different, otherwise they are considered compatible.  */
 
-bool
+static bool
 gimple_types_compatible_p (tree t1, tree t2, enum gtc_mode mode)
 {
   VEC(type_pair_t, heap) *sccstack = NULL;
index a5374a9620ce82588f0e3922a240ba1b6fe0e9c7..064888812399ab431e6121ba3417b8071f557fc2 100644 (file)
@@ -965,8 +965,6 @@ extern void recalculate_side_effects (tree);
 extern bool gimple_compare_field_offset (tree, tree);
 extern tree gimple_register_type (tree);
 extern tree gimple_register_canonical_type (tree);
-enum gtc_mode { GTC_MERGE = 0, GTC_DIAG = 1 };
-extern bool gimple_types_compatible_p (tree, tree, enum gtc_mode);
 extern void print_gimple_types_stats (void);
 extern void free_gimple_type_tables (void);
 extern tree gimple_unsigned_type (tree);
index 28a3d8b7bb877eafc76a6fd620a7d7e2b7293d6a..8dc10e8e6c5ce25ff60c76b399b4cfce25c04a63 100644 (file)
@@ -243,8 +243,8 @@ lto_cgraph_replace_node (struct cgraph_node *node,
 
   /* Redirect all incoming edges.  */
   compatible_p
-    = gimple_types_compatible_p (TREE_TYPE (TREE_TYPE (prevailing_node->decl)),
-                                TREE_TYPE (TREE_TYPE (node->decl)), GTC_DIAG);
+    = types_compatible_p (TREE_TYPE (TREE_TYPE (prevailing_node->decl)),
+                         TREE_TYPE (TREE_TYPE (node->decl)));
   for (e = node->callers; e; e = next)
     {
       next = e->next_caller;
@@ -360,8 +360,8 @@ lto_symtab_merge (lto_symtab_entry_t prevailing, lto_symtab_entry_t entry)
 
   if (TREE_CODE (decl) == FUNCTION_DECL)
     {
-      if (!gimple_types_compatible_p (TREE_TYPE (prevailing_decl),
-                                     TREE_TYPE (decl), GTC_DIAG))
+      if (!types_compatible_p (TREE_TYPE (prevailing_decl),
+                              TREE_TYPE (decl)))
        /* If we don't have a merged type yet...sigh.  The linker
           wouldn't complain if the types were mismatched, so we
           probably shouldn't either.  Just use the type from
@@ -390,11 +390,7 @@ lto_symtab_merge (lto_symtab_entry_t prevailing, lto_symtab_entry_t entry)
   prevailing_type = TYPE_MAIN_VARIANT (TREE_TYPE (prevailing_decl));
   type = TYPE_MAIN_VARIANT (TREE_TYPE (decl));
 
-  /* We have to register and fetch canonical types here as the global
-     fixup process didn't yet run.  */
-  prevailing_type = gimple_register_type (prevailing_type);
-  type = gimple_register_type (type);
-  if (!gimple_types_compatible_p (prevailing_type, type, GTC_DIAG))
+  if (!types_compatible_p (prevailing_type, type))
     {
       if (COMPLETE_TYPE_P (type))
        return false;
@@ -419,9 +415,7 @@ lto_symtab_merge (lto_symtab_entry_t prevailing, lto_symtab_entry_t entry)
          if (TREE_CODE (tem1) != TREE_CODE (tem2))
            return false;
 
-         if (!gimple_types_compatible_p (gimple_register_type (tem1),
-                                         gimple_register_type (tem2),
-                                         GTC_DIAG))
+         if (!types_compatible_p (tem1, tem2))
            return false;
        }
 
@@ -620,8 +614,7 @@ lto_symtab_merge_decls_2 (void **slot, bool diagnosed_p)
   /* Diagnose all mismatched re-declarations.  */
   FOR_EACH_VEC_ELT (tree, mismatches, i, decl)
     {
-      if (!gimple_types_compatible_p (TREE_TYPE (prevailing->decl),
-                                     TREE_TYPE (decl), GTC_DIAG))
+      if (!types_compatible_p (TREE_TYPE (prevailing->decl), TREE_TYPE (decl)))
        diagnosed_p |= warning_at (DECL_SOURCE_LOCATION (decl), 0,
                                   "type of %qD does not match original "
                                   "declaration", decl);
@@ -744,10 +737,6 @@ lto_symtab_merge_decls_1 (void **slot, void *data ATTRIBUTE_UNUSED)
       inform (DECL_SOURCE_LOCATION (prevailing->decl),
              "previously declared here");
 
-  /* Register and adjust types of the entries.  */
-  for (e = (lto_symtab_entry_t) *slot; e; e = e->next)
-    TREE_TYPE (e->decl) = gimple_register_type (TREE_TYPE (e->decl));
-
   /* Merge the chain to the single prevailing decl and diagnose
      mismatches.  */
   lto_symtab_merge_decls_2 (slot, diagnosed_p);
This page took 0.08995 seconds and 5 git commands to generate.