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
This commit is contained in:
parent
811582ec14
commit
378004b9d2
5 changed files with 120 additions and 2 deletions
|
@ -1,3 +1,9 @@
|
|||
2015-12-08 Jan Hubicka <hubicka@ucw.cz>
|
||||
|
||||
PR lto/68811
|
||||
* lto-symtab.c (lto_symtab_merge_decls_2): Decl can never be prevailed
|
||||
by itself.
|
||||
|
||||
2015-12-08 Jan Hubicka <hubicka@ucw.cz>
|
||||
|
||||
PR ipa/61886
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -1,3 +1,9 @@
|
|||
2015-12-08 Jan Hubicka <hubicka@ucw.cz>
|
||||
|
||||
PR lto/68811
|
||||
* g++.dg/lto/pr68811_0.C: New testcase.
|
||||
* g++.dg/lto/pr68811_1.C: New testcase.
|
||||
|
||||
2015-12-09 Paolo Carlini <paolo.carlini@oracle.com>
|
||||
|
||||
PR c++/60218
|
||||
|
|
11
gcc/testsuite/g++.dg/lto/pr68811_0.C
Normal file
11
gcc/testsuite/g++.dg/lto/pr68811_0.C
Normal file
|
@ -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);
|
||||
}
|
94
gcc/testsuite/g++.dg/lto/pr68811_1.C
Normal file
94
gcc/testsuite/g++.dg/lto/pr68811_1.C
Normal file
|
@ -0,0 +1,94 @@
|
|||
// { dg-options "-O2 -flto -w" }
|
||||
template <typename> class allocator;
|
||||
template <typename _CharT, typename = _CharT, typename = allocator<_CharT>>
|
||||
class Trans_NS___cxx11_basic_string;
|
||||
struct __false_type {};
|
||||
template <typename> using __void_t = void;
|
||||
template <typename, typename, template <typename...> class, typename...>
|
||||
struct __detector {
|
||||
using type = int;
|
||||
};
|
||||
template <typename _Default, template <typename...> class _Op,
|
||||
typename... _Args>
|
||||
struct __detector<_Default, __void_t<_Op<_Args...>>, _Op, _Args...> {
|
||||
using type = _Op<_Args...>;
|
||||
};
|
||||
template <typename _Default, template <typename...> class _Op,
|
||||
typename... _Args>
|
||||
using __detected_or = __detector<_Default, void, _Op, _Args...>;
|
||||
template <typename _Default, template <typename...> class _Op,
|
||||
typename... _Args>
|
||||
using __detected_or_t = typename __detected_or<_Default, _Op, _Args...>::type;
|
||||
template <template <typename...> class _Default,
|
||||
template <typename...> class _Op, typename... _Args>
|
||||
using __detected_or_t_ = __detected_or_t<_Default<_Args...>, _Op, _Args...>;
|
||||
struct random_access_iterator_tag {};
|
||||
class __undefined;
|
||||
template <typename, typename> using __replace_first_arg_t = __undefined;
|
||||
template <typename> class allocator {
|
||||
public:
|
||||
template <typename> struct rebind { typedef allocator other; };
|
||||
};
|
||||
struct __allocator_traits_base {
|
||||
template <typename _Alloc, typename _Up>
|
||||
using __rebind = typename _Alloc::template rebind<_Up>::other;
|
||||
template <typename _Tp> using __pointer = typename _Tp::pointer;
|
||||
template <typename _Tp> using __size_type = typename _Tp::size_type;
|
||||
};
|
||||
template <typename _Alloc, typename _Up>
|
||||
using __alloc_rebind =
|
||||
__detected_or_t_<__replace_first_arg_t, __allocator_traits_base::__rebind,
|
||||
_Alloc, _Up>;
|
||||
struct allocator_traits : __allocator_traits_base {
|
||||
using pointer = __detected_or_t<char, __pointer, allocator<char>>;
|
||||
using size_type = __detected_or_t<int, __size_type, allocator<char>>;
|
||||
template <typename _Tp>
|
||||
using rebind_alloc = __alloc_rebind<allocator<char>, _Tp>;
|
||||
};
|
||||
struct __alloc_traits : allocator_traits {
|
||||
struct rebind {
|
||||
typedef rebind_alloc<int> other;
|
||||
};
|
||||
};
|
||||
template <typename, typename, typename> class Trans_NS___cxx11_basic_string {
|
||||
public:
|
||||
struct _Alloc_hider : __alloc_traits::rebind::other {
|
||||
_Alloc_hider(__alloc_traits::pointer, allocator);
|
||||
} _M_dataplus;
|
||||
__alloc_traits::pointer _M_local_data();
|
||||
template <typename _InIterator>
|
||||
void _M_construct_aux(_InIterator __beg, _InIterator __end, __false_type) {
|
||||
_M_construct(__beg, __end, random_access_iterator_tag());
|
||||
}
|
||||
template <typename _InIterator>
|
||||
void _M_construct(_InIterator __beg, _InIterator __end) {
|
||||
_M_construct_aux(__beg, __end, __false_type());
|
||||
}
|
||||
template <typename _FwdIterator>
|
||||
void _M_construct(_FwdIterator, _FwdIterator, random_access_iterator_tag);
|
||||
char _S_copy___s2;
|
||||
void _S_copy(char *, __alloc_traits::size_type __n) {
|
||||
__builtin_memcpy(0, &_S_copy___s2, __n);
|
||||
}
|
||||
template <class _Iterator>
|
||||
void _S_copy_chars(char *__p, _Iterator __k1, _Iterator __k2) {
|
||||
_S_copy(__p, __k2 - __k1);
|
||||
}
|
||||
Trans_NS___cxx11_basic_string(char *__s,
|
||||
allocator<char> __a = allocator<char>())
|
||||
: _M_dataplus(_M_local_data(), __a) {
|
||||
_M_construct(__s, __s);
|
||||
}
|
||||
};
|
||||
template <typename _CharT, typename _Traits, typename _Alloc>
|
||||
template <typename _InIterator>
|
||||
void Trans_NS___cxx11_basic_string<_CharT, _Traits, _Alloc>::_M_construct(
|
||||
_InIterator __beg, _InIterator __end, random_access_iterator_tag) {
|
||||
_S_copy_chars(0, __beg, __end);
|
||||
}
|
||||
class Decimal {
|
||||
Trans_NS___cxx11_basic_string<char> toString() const;
|
||||
};
|
||||
Trans_NS___cxx11_basic_string<char> Decimal::toString() const {
|
||||
return "Infinity";
|
||||
}
|
Loading…
Add table
Reference in a new issue