From: Jan Hubicka Date: Wed, 9 Dec 2015 19:35:18 +0000 (+0100) Subject: re PR lto/68811 (ICE: in get, at cgraph.h:1218) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=378004b9d2633f4817da26feb2e07ba739b2eba1;p=gcc.git re PR lto/68811 (ICE: in get, at cgraph.h:1218) PR lto/68811 * g++.dg/lto/pr68811_0.C: New testcase. * g++.dg/lto/pr68811_1.C: New testcase. * lto-symtab.c (lto_symtab_merge_decls_2): Decl can never be prevailed by itself. From-SVN: r231473 --- diff --git a/gcc/lto/ChangeLog b/gcc/lto/ChangeLog index faeb3eedc70..9f0733d8249 100644 --- a/gcc/lto/ChangeLog +++ b/gcc/lto/ChangeLog @@ -1,3 +1,9 @@ +2015-12-08 Jan Hubicka + + PR lto/68811 + * lto-symtab.c (lto_symtab_merge_decls_2): Decl can never be prevailed + by itself. + 2015-12-08 Jan Hubicka PR ipa/61886 diff --git a/gcc/lto/lto-symtab.c b/gcc/lto/lto-symtab.c index a0cc1708d74..d4868c4dcd7 100644 --- a/gcc/lto/lto-symtab.c +++ b/gcc/lto/lto-symtab.c @@ -568,7 +568,8 @@ lto_symtab_merge_decls_2 (symtab_node *first, bool diagnosed_p) for (this_prevailing = prevailing; ; this_prevailing = this_prevailing->next_sharing_asm_name) { - if (lto_symtab_merge_p (this_prevailing->decl, e->decl)) + if (this_prevailing->decl != e->decl + && lto_symtab_merge_p (this_prevailing->decl, e->decl)) break; if (this_prevailing == last_prevailing) { @@ -709,7 +710,7 @@ lto_symtab_merge_decls_1 (symtab_node *first) && lto_symtab_symbol_p (e)) prevailing = e; } - /* For variables prefer the non-builtin if one is available. */ + /* For functions prefer the non-builtin if one is available. */ else if (TREE_CODE (prevailing->decl) == FUNCTION_DECL) { for (e = first; e; e = e->next_sharing_asm_name) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 20f62afa684..17f7b07e48a 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2015-12-08 Jan Hubicka + + PR lto/68811 + * g++.dg/lto/pr68811_0.C: New testcase. + * g++.dg/lto/pr68811_1.C: New testcase. + 2015-12-09 Paolo Carlini PR c++/60218 diff --git a/gcc/testsuite/g++.dg/lto/pr68811_0.C b/gcc/testsuite/g++.dg/lto/pr68811_0.C new file mode 100644 index 00000000000..2ae4eb06b5e --- /dev/null +++ b/gcc/testsuite/g++.dg/lto/pr68811_0.C @@ -0,0 +1,11 @@ +// { dg-lto-do link } +/* { dg-lto-options "-O2 -w" } */ +// { dg-extra-ld-options "-r -nostdlib" } +extern "C" char *strcpy(char *, const char *); +char InitXPCOMGlue_lastSlash; +void InitXPCOMGlue() { strcpy(&InitXPCOMGlue_lastSlash, ".so"); } +extern "C" void memcpy(void *); +char LZ4_decompress_safe_usingDict_ip; +void LZ4_decompress_safe_usingDict() { + memcpy(&LZ4_decompress_safe_usingDict_ip); +} diff --git a/gcc/testsuite/g++.dg/lto/pr68811_1.C b/gcc/testsuite/g++.dg/lto/pr68811_1.C new file mode 100644 index 00000000000..1f5b356ba97 --- /dev/null +++ b/gcc/testsuite/g++.dg/lto/pr68811_1.C @@ -0,0 +1,94 @@ +// { dg-options "-O2 -flto -w" } +template class allocator; +template > +class Trans_NS___cxx11_basic_string; +struct __false_type {}; +template using __void_t = void; +template class, typename...> +struct __detector { + using type = int; +}; +template class _Op, + typename... _Args> +struct __detector<_Default, __void_t<_Op<_Args...>>, _Op, _Args...> { + using type = _Op<_Args...>; +}; +template class _Op, + typename... _Args> +using __detected_or = __detector<_Default, void, _Op, _Args...>; +template class _Op, + typename... _Args> +using __detected_or_t = typename __detected_or<_Default, _Op, _Args...>::type; +template