diff options
author | Georg-Johann Lay <avr@gjlay.de> | 2016-11-30 11:08:37 +0000 |
---|---|---|
committer | Georg-Johann Lay <gjl@gcc.gnu.org> | 2016-11-30 11:08:37 +0000 |
commit | 6c8bf066581fe8bbd53e5967a49b6edd622f63b8 (patch) | |
tree | 5569173d7f8259bd0902a6989801aaeafa11bc8a /gcc | |
parent | e9472c81d3efe5996e501348cc218c2ab79f3f38 (diff) | |
download | gcc-6c8bf066581fe8bbd53e5967a49b6edd622f63b8.zip gcc-6c8bf066581fe8bbd53e5967a49b6edd622f63b8.tar.gz gcc-6c8bf066581fe8bbd53e5967a49b6edd622f63b8.tar.bz2 |
re PR lto/78562 (Wrong warning for built-in functions with -flto)
gcc/lto/
PR lto/78562
* lto-symtab.c (lto_symtab_merge_decls_2): Don't diagnose type
mismatch if the two types are built-in.
From-SVN: r243008
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/lto/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/lto/lto-symtab.c | 8 |
2 files changed, 14 insertions, 0 deletions
diff --git a/gcc/lto/ChangeLog b/gcc/lto/ChangeLog index 7957b2b..cf224806 100644 --- a/gcc/lto/ChangeLog +++ b/gcc/lto/ChangeLog @@ -1,3 +1,9 @@ +2016-11-30 Georg-Johann Lay <avr@gjlay.de> + + PR lto/78562 + * lto-symtab.c (lto_symtab_merge_decls_2): Don't diagnose type + mismatch if the two types are built-in. + 2016-11-26 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org> * lto-lang.c (lto_init): Remove initialization of ptrdiff_type_node. 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)); |