Created attachment 56759 [details] reduced testcase This crashes at the same place as PR107990, but with a different backtrace. It has common -fno-weak flag. The original testcase didn't output the warning: 'T::T()::U::U()' used but never defined Compiler output: $ x86_64-pc-linux-gnu-gcc -flto -fno-weak testcase.C testcase.C:7:7: warning: 'T::T()::U::U()' used but never defined 7 | U (); | ^ during IPA pass: *free_lang_data testcase.C:5:12: internal compiler error: in vague_linkage_p, at cp/decl2.cc:2329 5 | struct U | ^ 0x74d356 vague_linkage_p(tree_node*) /repo/gcc-trunk/gcc/cp/decl2.cc:2329 0x11394bf no_linkage_check(tree_node*, bool) /repo/gcc-trunk/gcc/cp/tree.cc:3022 0xfd1cf3 mangle_decl(tree_node*) /repo/gcc-trunk/gcc/cp/mangle.cc:4146 0x1ad0a8d decl_assembler_name(tree_node*) /repo/gcc-trunk/gcc/tree.cc:719 0x1af7747 assign_assembler_name_if_needed(tree_node*) /repo/gcc-trunk/gcc/tree.cc:834 0x2916760 free_lang_data_in_cgraph /repo/gcc-trunk/gcc/ipa-free-lang-data.cc:1064 0x2916760 free_lang_data /repo/gcc-trunk/gcc/ipa-free-lang-data.cc:1109 0x2916760 execute /repo/gcc-trunk/gcc/ipa-free-lang-data.cc:1176 Please submit a full bug report, with preprocessed source (by using -freport-bug). Please include the complete backtrace with any bug report. See <https://gcc.gnu.org/bugs/> for instructions. $ x86_64-pc-linux-gnu-gcc -v Using built-in specs. COLLECT_GCC=/repo/gcc-trunk/binary-latest-amd64/bin/x86_64-pc-linux-gnu-gcc COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-r14-6051-20231201105652-gb1fe98dee21-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/14.0.0/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++ --enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra --disable-bootstrap --with-cloog --with-ppl --with-isl --build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu --target=x86_64-pc-linux-gnu --with-ld=/usr/bin/x86_64-pc-linux-gnu-ld --with-as=/usr/bin/x86_64-pc-linux-gnu-as --disable-libstdcxx-pch --prefix=/repo/gcc-trunk//binary-trunk-r14-6051-20231201105652-gb1fe98dee21-checking-yes-rtl-df-extra-nobootstrap-amd64 Thread model: posix Supported LTO compression algorithms: zlib zstd gcc version 14.0.0 20231201 (experimental) (GCC)
Confirmed. Started with r6-1066-g233ce289250944: commit 233ce289250944dde071638799f9ba1a51a0a9bf Author: Jan Hubicka <hubicka@ucw.cz> Date: Sun May 24 21:38:14 2015 +0200 re PR lto/66180 (many -Wodr false positives when building LLVM with -flto) PR lto/66180 * ipa-devirt.c (type_with_linkage): Check that TYPE_STUB_DECL is set; check for assembler name at LTO time. (type_in_anonymous_namespace): Remove hacks, check that all anonymous types are called "<anon>" (odr_type_p): Simplify; add check for "<anon>" (odr_subtypes_equivalent): Add odr_type_p check. * tree.c (need_assembler_name_p): Even anonymous namespace needs assembler name. * mangle.c (mangle_decl): Mangle anonymous namespace types as "<anon>". * g++.dg/lto/pr66180_0.C: New testcase. * g++.dg/lto/pr66180_1.C: New testcase. From-SVN: r223633
GCC 6-13 has been released with this bug, so P2.
GCC 11 branch is being closed.