diff options
author | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-05-09 16:00:48 +0000 |
---|---|---|
committer | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-05-09 16:00:48 +0000 |
commit | 79e191db1cfc52305b6dd303607577ca52c340b0 (patch) | |
tree | a79ad85086404751a02141c8c0a58cefebf305df /gcc/lto-symtab.c | |
parent | 217bb9d2e8ce4f07a832b51ed630655807815758 (diff) | |
download | gcc-79e191db1cfc52305b6dd303607577ca52c340b0.tar.gz |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@173575 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/lto-symtab.c')
-rw-r--r-- | gcc/lto-symtab.c | 25 |
1 files changed, 7 insertions, 18 deletions
diff --git a/gcc/lto-symtab.c b/gcc/lto-symtab.c index 28a3d8b7bb8..8dc10e8e6c5 100644 --- a/gcc/lto-symtab.c +++ b/gcc/lto-symtab.c @@ -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); |