diff options
-rw-r--r-- | gcc/symtab.c | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/ipa/pr98057.C | 18 |
2 files changed, 22 insertions, 1 deletions
diff --git a/gcc/symtab.c b/gcc/symtab.c index fd7d553..6ceec55 100644 --- a/gcc/symtab.c +++ b/gcc/symtab.c @@ -1683,7 +1683,10 @@ symtab_node::set_section_for_node (const symtab_node &other) if (other.x_section) x_section = retain_section_hash_entry (other.x_section); else - x_section = NULL; + { + x_section = NULL; + implicit_section = false; + } } /* Workers for set_section. */ diff --git a/gcc/testsuite/g++.dg/ipa/pr98057.C b/gcc/testsuite/g++.dg/ipa/pr98057.C new file mode 100644 index 0000000..9de9254 --- /dev/null +++ b/gcc/testsuite/g++.dg/ipa/pr98057.C @@ -0,0 +1,18 @@ +/* PR ipa/98057 */ +/* { dg-do compile } */ +/* { dg-options "-O3 -ffunction-sections" } */ + +class JITSymbolResolver { + virtual void anchor(); +}; +class MemoryManager { + virtual void anchor(); +}; +class MCJITMemoryManager : MemoryManager { + void anchor(); +}; +class RTDyldMemoryManager : MCJITMemoryManager, JITSymbolResolver { + void anchor(); +}; +void RTDyldMemoryManager::anchor() {} +void MCJITMemoryManager::anchor() {} |