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

            Bug ID: 121831
           Summary: [15/16 regression] ICE when building melonds-1.0 with
                    LTO (expand_expr_real_2, at expr.cc:9779)
           Product: gcc
           Version: 16.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code, lto
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: sjames at gcc dot gnu.org
  Target Milestone: ---

Created attachment 62335
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=62335&action=edit
DMA.cpp.ii

Came across a bug report mentioning this by chance, not hit it in Gentoo. Shame
nobody reported it upstream as it was first found in May.

We ICE when building melonds-1.0 w/ LTO:
```
$ g++ -O3 -flto=auto -o /dev/null DMA.cpp.ii DMA_Timings.cpp.ii -shared
during RTL pass: expand
DMA.cpp.ii: In function ‘DMAUnitTimings9_16’:
DMA.cpp.ii:14:44: internal compiler error: in expand_expr_real_2, at
expr.cc:9765
   14 | void DMAUnitTimings9_16() { MRAMBurstTable = MRAMRead16Bursts[0]; }
      |                                            ^
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
See <https://bugs.gentoo.org/> for instructions.
make: *** [/tmp/ccIn5lUy.mk:2: /tmp/ccvr0esj.ltrans0.ltrans.o] Error 1
lto-wrapper: fatal error: make returned 2 exit status
compilation terminated.
/usr/lib/gcc/x86_64-pc-linux-gnu/16/../../../../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/16/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-pc-linux-gnu
Configured with:
/var/tmp/portage/sys-devel/gcc-16.0.9999/work/gcc-16.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/16
--includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/16/include
--datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/16
--mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/16/man
--infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/16/info
--with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/16/include/g++-v16
--disable-silent-rules --disable-dependency-tracking
--with-python-dir=/share/gcc-data/x86_64-pc-linux-gnu/16/python
--enable-libphobos --enable-objc-gc
--enable-languages=c,c++,d,objc,obj-c++,fortran,ada,cobol,m2,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 16.0.9999 p, commit
1c2de5bf7542dca179c0770f19cc70821033f59f' --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,mx32,m64 --disable-fixed-point
--with-abi=m64 --enable-targets=all --enable-offload-defaulted
--enable-offload-targets=nvptx-none --enable-libgomp --disable-libssp
--enable-libada --disable-cet --enable-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-gxx-libcxx-include-dir=/usr/include/c++/v1 --enable-linker-build-id
--with-build-config='bootstrap-O3 bootstrap-lto'
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 16.0.0 20250905 (experimental)
e3d14112b266479da9f8fd9c304e0ae15bf0ad25 (Gentoo Hardened 16.0.9999 p, commit
1c2de5bf7542dca179c0770f19cc70821033f59f)
```

Reply via email to