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

            Bug ID: 115396
           Summary: [15 regression] ICE in canon_file_name with LTO
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: lto
          Assignee: unassigned at gcc dot gnu.org
          Reporter: sjames at gcc dot gnu.org
                CC: mjires at gcc dot gnu.org
  Target Milestone: ---

I've hit this in a few places, e.g. automake's testsuite but for some reason
couldn't isolate it, but found an easier reproducer in enchant's testsuite.

I'm going to try cut it down more, but here's something for now.

```
$ ./foo.sh
+ rm gcc_output.txt
+ gcc -flto libenchant_2_la-lib.i libenchant_2_la-pwl.i -fPIC -shared -o k.so
+ g++ -flto -o /dev/null main_test-enchant_provider_get_user_language_tests.ii
k.so -lgmodule-2.0 -lglib-2.0 -lUnitTest++ -pthread
+ true
+ grep -q 'internal compiler error' gcc_output.txt
+ cat gcc_output.txt
lto-wrapper: warning: Extra option to ‘-Xassembler’: -O2, dropping all
‘-Xassembler’ and ‘-Wa’ options.
lto1: internal compiler error: Segmentation fault
0x561f0cd69c94 crash_signal
        /usr/src/debug/sys-devel/gcc-15.0.9999/gcc-15.0.9999/gcc/toplev.cc:319
0x561f0d617d2c canon_file_name
       
/usr/src/debug/sys-devel/gcc-15.0.9999/gcc-15.0.9999/gcc/lto-streamer-in.cc:353
0x561f0d617d2c lto_location_cache::input_location_and_block(unsigned int*,
bitpack_d*, lto_input_block*, data_in*)
       
/usr/src/debug/sys-devel/gcc-15.0.9999/gcc-15.0.9999/gcc/lto-streamer-in.cc:566
0x561f0d60eb85 lto_location_cache::input_location(unsigned int*, bitpack_d*,
data_in*)
       
/usr/src/debug/sys-devel/gcc-15.0.9999/gcc-15.0.9999/gcc/lto-streamer-in.cc:620
0x561f0d60eb85 lto_input_location(unsigned int*, bitpack_d*, data_in*)
       
/usr/src/debug/sys-devel/gcc-15.0.9999/gcc-15.0.9999/gcc/lto-streamer-in.cc:631
0x561f0d60eb85 streamer_read_tree_bitfields(lto_input_block*, data_in*,
tree_node*)
       
/usr/src/debug/sys-devel/gcc-15.0.9999/gcc-15.0.9999/gcc/tree-streamer-in.cc:532
0x561f0d60d80e lto_read_tree_1
       
/usr/src/debug/sys-devel/gcc-15.0.9999/gcc-15.0.9999/gcc/lto-streamer-in.cc:1720
0x561f0d60b9bb lto_read_tree
       
/usr/src/debug/sys-devel/gcc-15.0.9999/gcc-15.0.9999/gcc/lto-streamer-in.cc:1772
0x561f0d60b9bb lto_input_tree_1(lto_input_block*, data_in*, LTO_tags, unsigned
int)
       
/usr/src/debug/sys-devel/gcc-15.0.9999/gcc-15.0.9999/gcc/lto-streamer-in.cc:1917
0x561f0d606682 lto_input_scc(lto_input_block*, data_in*, unsigned int*,
unsigned int*, bool)
       
/usr/src/debug/sys-devel/gcc-15.0.9999/gcc-15.0.9999/gcc/lto-streamer-in.cc:1801
0x561f0d606682 lto_read_decls
       
/usr/src/debug/sys-devel/gcc-15.0.9999/gcc-15.0.9999/gcc/lto/lto-common.cc:1911
0x561f0d606682 lto_file_finalize
       
/usr/src/debug/sys-devel/gcc-15.0.9999/gcc-15.0.9999/gcc/lto/lto-common.cc:2299
0x561f0d606682 lto_create_files_from_ids
       
/usr/src/debug/sys-devel/gcc-15.0.9999/gcc-15.0.9999/gcc/lto/lto-common.cc:2309
0x561f0d606682 lto_file_read
       
/usr/src/debug/sys-devel/gcc-15.0.9999/gcc-15.0.9999/gcc/lto/lto-common.cc:2364
0x561f0d606682 read_cgraph_and_symbols(unsigned int, char const**)
       
/usr/src/debug/sys-devel/gcc-15.0.9999/gcc-15.0.9999/gcc/lto/lto-common.cc:2812
0x561f0dd61eea lto_main()
        /usr/src/debug/sys-devel/gcc-15.0.9999/gcc-15.0.9999/gcc/lto/lto.cc:658
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://bugs.gentoo.org/> for instructions.
lto-wrapper: fatal error: g++ returned 1 exit status
compilation terminated.
/usr/lib/gcc/x86_64-pc-linux-gnu/15/../../../../x86_64-pc-linux-gnu/bin/ld:
error: lto-wrapper failed
collect2: error: ld returned 1 exit status
```

--

Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-pc-linux-gnu/15/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with:
/var/tmp/portage/sys-devel/gcc-15.0.9999/work/gcc-15.0.9999/configure
--host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --prefix=/usr
--bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/15
--includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/15/include
--datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/15
--mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/15/man
--infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/15/info
--with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/15/include/g++-v15
--disable-silent-rules --disable-dependency-tracking
--with-python-dir=/share/gcc-data/x86_64-pc-linux-gnu/15/python
--enable-languages=c,c++,fortran,rust --enable-obsolete --enable-secureplt
--disable-werror --with-system-zlib --enable-nls --without-included-gettext
--disable-libunwind-exceptions --enable-checking=yes,extra,rtl
--with-bugurl=https://bugs.gentoo.org/ --with-pkgversion='Gentoo Hardened
15.0.9999 p, commit 9a866462097fe24696c924a3874fd307c775e860'
--with-gcc-major-version-only --enable-libstdcxx-time --enable-lto
--disable-libstdcxx-pch --enable-shared --enable-threads=posix
--enable-__cxa_atexit --enable-clocale=gnu --enable-multilib
--with-multilib-list=m32,m64 --disable-fixed-point --enable-targets=all
--enable-libgomp --disable-libssp --disable-libada --disable-cet
--disable-systemtap --enable-valgrind-annotations --disable-vtable-verify
--disable-libvtv --with-zstd --with-isl --disable-isl-version-check
--enable-default-pie --enable-host-pie --enable-host-bind-now
--enable-default-ssp --disable-fixincludes --with-build-config='bootstrap-O3
bootstrap-lto'
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 15.0.0 20240607 (experimental)
a3d68b5155018817dd7eef5abbaeadf3959b8e5e (Gentoo Hardened 15.0.9999 p, commit
9a866462097fe24696c924a3874fd307c775e860)

Reply via email to