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

            Bug ID: 122915
           Summary: ICE in module_state::write_using_directives
           Product: gcc
           Version: 16.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: robert.broglia at gmail dot com
  Target Milestone: ---

I recently made my library into a C++ module but am getting an ICE when trying
to use it in another module. After commenting out most of the code I isolated
it to a using directive related to my std::function-like class
(IG::DelegateFunc). I also get the ICE if bring in the whole library namespace
with using IG. Please see the output below and let me know if any other info is
needed.

// 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-languages=c,c++ --enable-obsolete --enable-secureplt --disable-werror
--with-system-zlib --enable-nls --without-included-gettext
--disable-libunwind-exceptions --enable-checking=yes,extra
--with-bugurl=https://bugs.gentoo.org/ --with-pkgversion='Gentoo 16.0.9999 p,
commit d93ac8e926116356695925acea88cb496d9ddaa8' --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-offload-defaulted
--enable-offload-targets=nvptx-none --enable-libgomp --disable-libssp
--disable-libada --enable-cet --disable-systemtap
--disable-valgrind-annotations --disable-vtable-verify --disable-libvtv
--with-zstd --without-isl --enable-default-pie --enable-host-pie
--enable-host-bind-now --enable-default-ssp --disable-fixincludes
--with-gxx-libcxx-include-dir=/usr/include/c++/v1
--with-build-config='bootstrap-O3 bootstrap-lto bootstrap-cet'
// Thread model: posix
// Supported LTO compression algorithms: zlib zstd
// gcc version 16.0.0 20251127 (experimental)
319a956cd25ccc05c9447d55d76f0c98e8f6b598 (Gentoo 16.0.9999 p, commit
d93ac8e926116356695925acea88cb496d9ddaa8) 
// 
// /home/robert/projects/imagine/tests/FrameRateTest/src/main/tests.ccm:401:8:
internal compiler error: in operator(), at cp/module.cc:17633
//   401 | export module tests;
//       |        ^~~~~~
// 0x55555710d798 internal_error(char const*, ...)
//      ???:0
// 0x55555710d93b fancy_abort(char const*, int, char const*)
//      ???:0
// 0x555556847300 module_state::write_using_directives(elf_out*, depset::hash&,
vec<depset*, va_heap, vl_ptr>, unsigned int*)
//      ???:0
// 0x555556852e4e module_state::write_begin(elf_out*, cpp_reader*,
module_state_config&, unsigned int&)
//      ???:0
// 0x555557375220 c_parse_final_cleanups()
//      ???:0
// 0x555557ec4233 c_common_parse_file()
//      ???:0
// Please submit a full bug report, with preprocessed source.
// Please include the complete backtrace with any bug report.
// See <https://bugs.gentoo.org/> for instructions.

// /usr/libexec/gcc/x86_64-pc-linux-gnu/16/cc1plus -quiet -MD
CMakeFiles/frameRateTest.dir/Debug/src/main/tests.ccm.d -MF
CMakeFiles/frameRateTest.dir/Debug/src/main/tests.ccm.o.d -MT
CMakeFiles/frameRateTest.dir/Debug/src/main/tests.ccm.o -D_GNU_SOURCE
/home/robert/projects/imagine/tests/FrameRateTest/src/main/tests.ccm
-fdeps-file=CMakeFiles/frameRateTest.dir/Debug/src/main/tests.ccm.ddi
-fdeps-target=CMakeFiles/frameRateTest.dir/Debug/src/main/tests.ccm.o -quiet
-dumpdir CMakeFiles/frameRateTest.dir/Debug/src/main/ -dumpbase tests.ccm.ccm
-dumpbase-ext .ccm -mtune=generic -march=x86-64 -std=gnu++26 -fmodules
-fmodule-mapper=CMakeFiles/frameRateTest.dir/Debug/src/main/tests.ccm.o.modmap
-fdeps-format=p1689r5 -freport-bug -foffload-options=-fno-stack-protector
-fcf-protection -foffload-options=-fcf-protection=none -o - -frandom-seed=0
-fdump-noaddr

# 0 "/home/robert/projects/imagine/tests/FrameRateTest/src/main/tests.ccm"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "/home/robert/projects/imagine/tests/FrameRateTest/src/main/tests.ccm"
# 401 "/home/robert/projects/imagine/tests/FrameRateTest/src/main/tests.ccm"
export module tests;
import imagine;

using TestFinishedDelegate = IG::DelegateFunc<int(int)>;

Reply via email to