summaryrefslogtreecommitdiff
path: root/gcc/lto-symtab.c
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2010-12-10 15:53:58 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2010-12-10 15:53:58 +0000
commit1b9e1cc04834f67c1e9f35a811f5333ec20bcca5 (patch)
treed620a38c859ec655c97f3ad337095c439fb24350 /gcc/lto-symtab.c
parent8593ce89f3892cdc106c3502c98cc322fb41b09a (diff)
downloadgcc-1b9e1cc04834f67c1e9f35a811f5333ec20bcca5.tar.gz
2010-12-10 Richard Guenther <rguenther@suse.de>
PR lto/46808 * lto-symtab.c (lto_symtab_merge_decls_2): Avoid type warnings after errors. (lto_symtab_merge_decls_1): Adjust. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@167690 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/lto-symtab.c')
-rw-r--r--gcc/lto-symtab.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/gcc/lto-symtab.c b/gcc/lto-symtab.c
index c86bbcc8a5a..f18b32224c3 100644
--- a/gcc/lto-symtab.c
+++ b/gcc/lto-symtab.c
@@ -593,16 +593,16 @@ found:
}
/* Merge all decls in the symbol table chain to the prevailing decl and
- issue diagnostics about type mismatches. */
+ issue diagnostics about type mismatches. If DIAGNOSED_P is true
+ do not issue further diagnostics.*/
static void
-lto_symtab_merge_decls_2 (void **slot)
+lto_symtab_merge_decls_2 (void **slot, bool diagnosed_p)
{
lto_symtab_entry_t prevailing, e;
VEC(tree, heap) *mismatches = NULL;
unsigned i;
tree decl;
- bool diagnosed_p = false;
/* Nothing to do for a single entry. */
prevailing = (lto_symtab_entry_t) *slot;
@@ -612,7 +612,8 @@ lto_symtab_merge_decls_2 (void **slot)
/* Try to merge each entry with the prevailing one. */
for (e = prevailing->next; e; e = e->next)
{
- if (!lto_symtab_merge (prevailing, e))
+ if (!lto_symtab_merge (prevailing, e)
+ && !diagnosed_p)
VEC_safe_push (tree, heap, mismatches, e->decl);
}
if (VEC_empty (tree, mismatches))
@@ -751,12 +752,7 @@ lto_symtab_merge_decls_1 (void **slot, void *data ATTRIBUTE_UNUSED)
/* Merge the chain to the single prevailing decl and diagnose
mismatches. */
- lto_symtab_merge_decls_2 (slot);
-
- /* Drop all but the prevailing decl from the symtab. */
- if (TREE_CODE (prevailing->decl) != FUNCTION_DECL
- && TREE_CODE (prevailing->decl) != VAR_DECL)
- prevailing->next = NULL;
+ lto_symtab_merge_decls_2 (slot, diagnosed_p);
/* Store resolution decision into the callgraph.
In LTRANS don't overwrite information we stored into callgraph at