[go: nahoru, domu]

Bug 112815 - [11/12/13/14/15 Regression] ICE: in vague_linkage_p, at cp/decl2.cc:2329 with -flto -fno-weak
Summary: [11/12/13/14/15 Regression] ICE: in vague_linkage_p, at cp/decl2.cc:2329 with...
Status: NEW
Alias: None
Product: gcc
Classification: Unclassified
Component: ipa (show other bugs)
Version: 14.0
: P2 normal
Target Milestone: 11.5
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-on-valid-code, lto, non-weak
Depends on:
Blocks:
 
Reported: 2023-12-01 21:07 UTC by Zdenek Sojka
Modified: 2024-04-26 10:55 UTC (History)
4 users (show)

See Also:
Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu
Build:
Known to work:
Known to fail:
Last reconfirmed: 2024-01-18 00:00:00


Attachments
reduced testcase (61 bytes, text/plain)
2023-12-01 21:07 UTC, Zdenek Sojka
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Zdenek Sojka 2023-12-01 21:07:34 UTC
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)
Comment 1 Marek Polacek 2024-01-18 19:44:25 UTC
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
Comment 2 Jakub Jelinek 2024-03-12 13:22:25 UTC
GCC 6-13 has been released with this bug, so P2.