https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123993

            Bug ID: 123993
           Summary: ICE in symtab_node::verify_symtab_nodes when building
                    marknote
           Product: gcc
           Version: 16.0
            Status: UNCONFIRMED
          Keywords: ice-checking, ice-on-valid-code, lto
          Severity: normal
          Priority: P3
         Component: lto
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jmelcr at gcc dot gnu.org
  Target Milestone: ---
              Host: x86_64-pc-linux-gnu
            Target: x86_64-pc-linux-gnu

Created attachment 63598
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=63598&action=edit
Reproducers

$ ~/gcc/build/bisect/install/bin/g++ -flto -w marknotesettings.cpp.ii
config.cpp.ii
lto1: error: Two symbols with same comdat_group are not linked by the
same_comdat_group list.
_ZN12ConfigHelperD0Ev/15 (__dt_del )
  Type: function definition analyzed
  Visibility: externally_visible semantic_interposition no_reorder undef public
weak comdat comdat_group:_ZN12ConfigHelperD5Ev one_only virtual artificial
  Address is taken.
  References:
  Referring: _ZTV12ConfigHelper/13 (addr)
  Read from file: /tmp/cczV8Y2U.o
  Unit id: 2
  Function flags:
  Called by:
  Calls: _ZdlPvm/9 _ZN12ConfigHelperD1Ev/4
_ZN12ConfigHelperD1Ev/4 (__dt_comp )
  Type: function definition analyzed alias
  Visibility: externally_visible semantic_interposition prevailing_def_ironly
public weak comdat comdat_group:_ZN12ConfigHelperD5Ev one_only
  Same comdat group as: _ZN12ConfigHelperD2Ev/1
  Address is taken.
  References: _ZN12ConfigHelperD2Ev/1 (alias)
  Referring: _Z41__static_initialization_and_destruction_0v/5 (addr)
_ZTV12ConfigHelper/13 (addr)
  Read from file: /tmp/cc65YYPS.o
  Unit id: 1
  Function flags: merged_comdat
  Called by: _ZN12ConfigHelperD0Ev/15
  Calls:
during IPA pass: modref
lto1: internal compiler error: symtab_node::verify failed
0x247d2cd internal_error(char const*, ...)
        /home/jmelcr/gcc/src/gcc/gcc/diagnostic-global-context.cc:787
0xaf9ac6 symtab_node::verify_symtab_nodes()
        /home/jmelcr/gcc/src/gcc/gcc/symtab.cc:1521
0xe40a4b symtab_node::checking_verify_symtab_nodes()
        /home/jmelcr/gcc/src/gcc/gcc/cgraph.h:730
0xe40a4b symbol_table::remove_unreachable_nodes(_IO_FILE*)
        /home/jmelcr/gcc/src/gcc/gcc/ipa.cc:695
0xa6e1c2 read_cgraph_and_symbols(unsigned int, char const**)
        /home/jmelcr/gcc/src/gcc/gcc/lto/lto-common.cc:3008
0xa4c252 lto_main()
        /home/jmelcr/gcc/src/gcc/gcc/lto/lto.cc:663
/home/jmelcr/gcc/build/bisect/install/libexec/gcc/x86_64-pc-linux-gnu/16.0.1/lto1
-quiet -dumpbase ./a.wpa -mtune=generic -march=x86-64 -w -fno-openmp
-fno-openacc -fno-pie -fcf-protection=none
-fltrans-output-list=/tmp/ccU707I2.ltrans.out -fwpa
-fresolution=/tmp/ccdD9L3R.res -flinker-output=exec @/tmp/ccinSPxy
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.
lto-wrapper: fatal error: /home/jmelcr/gcc/build/bisect/install/bin/g++
returned 1 exit status
compilation terminated.
/usr/bin/ld: error: lto-wrapper failed
collect2: error: ld returned 1 exit status

$ ~/gcc/build/bisect/install/bin/g++ -v
Using built-in specs.
COLLECT_GCC=/home/jmelcr/gcc/build/bisect/install/bin/g++
COLLECT_LTO_WRAPPER=/home/jmelcr/gcc/build/bisect/install/libexec/gcc/x86_64-pc-linux-gnu/16.0.1/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /home/jmelcr/gcc/src/gcc/configure
--prefix=/home/jmelcr/gcc/build/bisect/install --enable-languages=c,c++
--disable-bootstrap : (reconfigured) /home/jmelcr/gcc/src/gcc/configure
--prefix=/home/jmelcr/gcc/build/bisect/install --disable-bootstrap
--enable-languages=c,c++,lto --no-create --no-recursion : (reconfigured)
/home/jmelcr/gcc/src/gcc/configure
--prefix=/home/jmelcr/gcc/build/bisect/install --enable-languages=c,c++
--disable-bootstrap --enable-checking
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 16.0.1 20260203 (experimental) (GCC)

The ICE is sensitive to file order.

Reply via email to