Tolerate different definitions of symbols in lto
gcc/ PR lto/64076 * ipa-visibility.c (update_visibility_by_resolution_info): Only assert when not in lto mode. From-SVN: r220561
This commit is contained in:
parent
32721b2cb5
commit
a9e083cc43
@ -1,3 +1,9 @@
|
||||
2015-02-09 Trevor Saunders <tsaunders@mozilla.com>
|
||||
|
||||
PR lto/64076
|
||||
* ipa-visibility.c (update_visibility_by_resolution_info): Only
|
||||
assert when not in lto mode.
|
||||
|
||||
2015-02-09 Zhouyi Zhou <yizhouzhou@ict.ac.cn>
|
||||
|
||||
* ira-color.c (setup_left_conflict_sizes_p): Simplify
|
||||
|
@ -424,11 +424,19 @@ update_visibility_by_resolution_info (symtab_node * node)
|
||||
if (node->same_comdat_group)
|
||||
for (symtab_node *next = node->same_comdat_group;
|
||||
next != node; next = next->same_comdat_group)
|
||||
gcc_assert (!next->externally_visible
|
||||
|| define == (next->resolution == LDPR_PREVAILING_DEF_IRONLY
|
||||
|| next->resolution == LDPR_PREVAILING_DEF
|
||||
|| next->resolution == LDPR_UNDEF
|
||||
|| next->resolution == LDPR_PREVAILING_DEF_IRONLY_EXP));
|
||||
{
|
||||
if (!next->externally_visible)
|
||||
continue;
|
||||
|
||||
bool same_def
|
||||
= define == (next->resolution == LDPR_PREVAILING_DEF_IRONLY
|
||||
|| next->resolution == LDPR_PREVAILING_DEF
|
||||
|| next->resolution == LDPR_UNDEF
|
||||
|| next->resolution == LDPR_PREVAILING_DEF_IRONLY_EXP);
|
||||
gcc_assert (in_lto_p || same_def);
|
||||
if (!same_def)
|
||||
return;
|
||||
}
|
||||
|
||||
if (node->same_comdat_group)
|
||||
for (symtab_node *next = node->same_comdat_group;
|
||||
|
20
gcc/testsuite/g++.dg/lto/pr64076.H
Normal file
20
gcc/testsuite/g++.dg/lto/pr64076.H
Normal file
@ -0,0 +1,20 @@
|
||||
struct Base {
|
||||
virtual void f() = 0;
|
||||
};
|
||||
|
||||
struct X : public Base { };
|
||||
struct Y : public Base { };
|
||||
struct Z : public Base { };
|
||||
struct T : public Base { };
|
||||
|
||||
struct S : public X, public Y, public Z
|
||||
#ifdef XXX
|
||||
, public T
|
||||
#endif
|
||||
{
|
||||
void f()
|
||||
#ifdef XXX
|
||||
{ }
|
||||
#endif
|
||||
;
|
||||
};
|
10
gcc/testsuite/g++.dg/lto/pr64076_0.C
Normal file
10
gcc/testsuite/g++.dg/lto/pr64076_0.C
Normal file
@ -0,0 +1,10 @@
|
||||
// { dg-lto-do link }
|
||||
|
||||
#define XXX
|
||||
#include "pr64076.H"
|
||||
|
||||
int main()
|
||||
{
|
||||
S s;
|
||||
return 0;
|
||||
}
|
5
gcc/testsuite/g++.dg/lto/pr64076_1.C
Normal file
5
gcc/testsuite/g++.dg/lto/pr64076_1.C
Normal file
@ -0,0 +1,5 @@
|
||||
// { dg-options -fno-lto }
|
||||
|
||||
#include "pr64076.H"
|
||||
|
||||
void S::f() { }
|
Loading…
Reference in New Issue
Block a user