aboutsummaryrefslogtreecommitdiff
path: root/gcc/lto/lto-symtab.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/lto/lto-symtab.c')
-rw-r--r--gcc/lto/lto-symtab.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc/lto/lto-symtab.c b/gcc/lto/lto-symtab.c
index ce9e146..5ab9977 100644
--- a/gcc/lto/lto-symtab.c
+++ b/gcc/lto/lto-symtab.c
@@ -655,6 +655,14 @@ lto_symtab_merge_decls_2 (symtab_node *first, bool diagnosed_p)
/* Diagnose all mismatched re-declarations. */
FOR_EACH_VEC_ELT (mismatches, i, decl)
{
+ /* Do not diagnose two built-in declarations, there is no useful
+ location in that case. It also happens for AVR if two built-ins
+ use the same asm name because their libgcc assembler code is the
+ same, see PR78562. */
+ if (DECL_IS_BUILTIN (prevailing->decl)
+ && DECL_IS_BUILTIN (decl))
+ continue;
+
int level = warn_type_compatibility_p (TREE_TYPE (prevailing->decl),
TREE_TYPE (decl),
DECL_COMDAT (decl));