https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61577
--- Comment #185 from Peter Bisroev <peter.bisroev at groundlabs dot com> --- (In reply to dave.anglin from comment #184) > On 2020-02-15 12:56 a.m., peter.bisroev at groundlabs dot com wrote: > > So we made some progress here. I have rebuilt 4.7.4 with --enable-comdat. 3 > > stage bootstrap went fine (running 'make check' now). Using that tried to > > bootstrap 4.9.4 again. We are getting a lot less PCREL21B relocation issues > > when linking cc1plus. For example: > So, it looks like we have garbage collection for COMDAT functions but not > for weak functions. I finished running 'make check' tests for gcc 4.7.4 that was compiled with --enable-comdat. I get exactly the same results as before, exactly the same tests pass and fail that you have reviewed previously. So I guess we can say this build works as good as the one without --enable-comdat. The difference however is in reduced number of PCREL21B errors as show in my comment before. Additionally I have tried compiling 8.3.0 with comdat enabled 4.7.4 (just like I tried with 4.9.4). In this case we also get a significantly reduced number of PCREL21B errors. For example, originally for cc1plus, we went from 569 errors to 58. > I think we need to look at branch types - "br.call.sptk.many" versus > "br.call.dptk.many". I suspect using > the latter would fix the PCREL21B relocation issues. Sorry for my lack of knowledge here, would you be able to explain this a bit more if you get a chance? I looked up IA-64 arch manual, and the diff between these two branch types is that '.sptk' one uses static taken prediction strategy and '.dptk' uses dynamic taken prediction strategy. The mechanics here make sense to me but I am not sure I understand how they relate to the relocation issue here. Thanks! --peter