https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63892
--- Comment #19 from Iain Sandoe <iains at gcc dot gnu.org> --- Created attachment 34836 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=34836&action=edit testcase to discuss. So with the patch above, I get a failure to build LLVM stage#1. the .ii here is a reduced case. TBH , I'm not sure what to make of this - on a debugging stage#1 compiler on Darwin (only need a cc1plus). gcc/cc1plus -fpreprocessed t.ii -fPIC -quiet -dumpbase t.ii -mmacosx-version-min=10.8.6 -mtune=core2 -auxbase t -O2 -std=c++11 -version -o t.s ==== I'm not understanding why getAnalysisUsage() is saying it's called by addEscapingUse() and vice-versa … that's not what the source says. Is this because the bodies of the functions are equivalent (i.e. both empty)? In which case I guess the referring pointers need to be moved to the original before the alias is deleted… not 100% sure how to do that .. --- Breakpoint 2, ipa_icf::sem_function::merge (this=0x142a21660, alias_item=0x142a21860) at /GCC/gcc-trunk/gcc/ipa-icf.c:734 734 alias->remove (); (gdb) p alias->debug() _ZNK12_GLOBAL__N_14NoAA16getAnalysisUsageERN4llvm13AnalysisUsageE/9 (virtual void {anonymous}::NoAA::getAnalysisUsage(llvm::AnalysisUsage&) const) @0x143969310 Type: function definition analyzed Visibility: prevailing_def_ironly virtual Address is taken. References: Referring: _ZTVN12_GLOBAL__N_14NoAAE/17 (addr) Availability: available First run: 0 Function flags: body icf_merged Called by: Calls: $1 = void Current language: auto; currently c++ (gdb) p original->debug() _ZN12_GLOBAL__N_14NoAA14addEscapingUseERN4llvm3UseE/11 (virtual void {anonymous}::NoAA::addEscapingUse(llvm::Use&)) @0x143975188 Type: function definition analyzed Visibility: prevailing_def_ironly virtual Address is taken. References: Referring: _ZTVN12_GLOBAL__N_14NoAAE/17 (addr) Availability: available First run: 0 Function flags: body Called by: _ZThn8_NK12_GLOBAL__N_14NoAA16getAnalysisUsageERN4llvm13AnalysisUsageE/10 (1.00 per call) _ZThn8_N12_GLOBAL__N_14NoAA14addEscapingUseERN4llvm3UseE/12 (1.00 per call) Calls: $2 = void (gdb) p local_original->debug() _ZN12_GLOBAL__N_14NoAA14addEscapingUseERN4llvm3UseE/11 (virtual void {anonymous}::NoAA::addEscapingUse(llvm::Use&)) @0x143975188 Type: function definition analyzed Visibility: prevailing_def_ironly virtual Address is taken. References: Referring: _ZTVN12_GLOBAL__N_14NoAAE/17 (addr) Availability: available First run: 0 Function flags: body Called by: _ZThn8_NK12_GLOBAL__N_14NoAA16getAnalysisUsageERN4llvm13AnalysisUsageE/10 (1.00 per call) _ZThn8_N12_GLOBAL__N_14NoAA14addEscapingUseERN4llvm3UseE/12 (1.00 per call) Calls: $3 = void