https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124732
Bug ID: 124732
Summary: internal compiler error: in install_entity, at
cp/module.cc:8298 (building C++ modules code)
Product: gcc
Version: 16.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: sebj_coder3 at pm dot me
Target Milestone: ---
Created attachment 64106
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=64106&action=edit
gzipped Preprocessed source from -freport-bug
I get an ICE in g++-16 in my C++ modules project.
The issue is in a class which manages colour maps (to map scalars to RGB colour
triplets).
I've reduced it down to a simple program that instantiates a ColourMap and
triggers the error (compiling with gcc master branch at commit 5312b5132ce).
Steps to reproduce:
# Dependencies are OpenGL, Freetype and GLFW (only for the top level
CMakeLists,
# the bug-generating code won't use these). Run your distro's equivalent of the
# Debian-like:
sudo apt install ninja-build \
librapidxml-dev freeglut3-dev libglu1-mesa-dev libxmu-dev \
libxi-dev libglfw3-dev libfreetype-dev
# Clone mathplot
git clone [email protected]:sebsjames/mathplot
cd mathplot
# Check out he modules branch and init/update two submodules
git checkout dev/modules # Commit df97029, dated 2026/03/21
git submodule init
git submodule update
mkdir build
cd build
# Configure, with the option to build my bugreport programs
CC=/path/to/gcc CXX=/path/to/g++ cmake .. -GNinja -DBUILD_BUGREP=ON
# Build the 'cmap' program that is associated with this report:
ninja cmap
Output:
[14:49:39 bgcc] ninja cmap
[1/3] Building CXX object bugrep/CMakeFiles/cmap.dir/__/mplot/ColourMap.cppm.o
FAILED: bugrep/CMakeFiles/cmap.dir/__/mplot/ColourMap.cppm.o
bugrep/CMakeFiles/cmap.dir/mplot.colourmap.gcm
/opt/gcc-master/bin/g++ -I/home/seb/src/mathplot -I/usr/include/hdf5/serial
-I/usr/include/freetype2 -I/home/seb/src/mathplot/maths
-I/home/seb/src/mathplot/json/include
-I/home/seb/src/mathplot/include/rapidxml-1.13 -g -Wall -Wextra -Wpedantic
-pedantic-errors -Werror -Wfatal-errors -Wno-psabi -O3
-fconstexpr-ops-limit=5000000000 -DMPLOT_HAVE_STD_FORMAT -fopenmp
-DMPLOT_FONTS_DIR="\"/home/seb/src/mathplot/fonts\"" -freport-bug -std=gnu++23
-MD -MT bugrep/CMakeFiles/cmap.dir/__/mplot/ColourMap.cppm.o -MF
bugrep/CMakeFiles/cmap.dir/__/mplot/ColourMap.cppm.o.d -fmodules-ts
-fmodule-mapper=bugrep/CMakeFiles/cmap.dir/__/mplot/ColourMap.cppm.o.modmap -MD
-fdeps-format=p1689r5 -x c++ -o
bugrep/CMakeFiles/cmap.dir/__/mplot/ColourMap.cppm.o -c
/home/seb/src/mathplot/mplot/ColourMap.cppm
/home/seb/src/mathplot/mplot/ColourMap.cppm:228:9: internal compiler error: in
install_entity, at cp/module.cc:8298
228 | sm::flags<mplot::ColourMapFlags> makeColourMapFlags (const
mplot::ColourMapType t)
| ^~~~~
0x2ae6b7f internal_error(char const*, ...)
../../gcc/gcc/diagnostic-global-context.cc:787
0xb4bb59 fancy_abort(char const*, int, char const*)
../../gcc/gcc/diagnostics/context.cc:1813
0x84d88e install_entity
../../gcc/gcc/cp/module.cc:8298
0x84d88e decl_value
../../gcc/gcc/cp/module.cc:8877
0xcf80d4 tree_node
../../gcc/gcc/cp/module.cc:10437
0xd010a6 module_state::read_cluster(unsigned int)
../../gcc/gcc/cp/module.cc:17682
0xd01b8f module_state::load_section(unsigned int, binding_slot*)
../../gcc/gcc/cp/module.cc:21516
0xd01c46 module_state::lazy_load(unsigned int, binding_slot*)
../../gcc/gcc/cp/module.cc:22539
0xcf9c05 tree_node
../../gcc/gcc/cp/module.cc:11045
0xd00cfb module_state::read_cluster(unsigned int)
../../gcc/gcc/cp/module.cc:17519
0xd01b8f module_state::load_section(unsigned int, binding_slot*)
../../gcc/gcc/cp/module.cc:21516
0xd01c46 module_state::lazy_load(unsigned int, binding_slot*)
../../gcc/gcc/cp/module.cc:22539
0xcf9c05 tree_node
../../gcc/gcc/cp/module.cc:11045
0xd00cfb module_state::read_cluster(unsigned int)
../../gcc/gcc/cp/module.cc:17519
0xd01b8f module_state::load_section(unsigned int, binding_slot*)
../../gcc/gcc/cp/module.cc:21516
0xd01c46 module_state::lazy_load(unsigned int, binding_slot*)
../../gcc/gcc/cp/module.cc:22539
0xcf9c05 tree_node
../../gcc/gcc/cp/module.cc:11045
0xd00cfb module_state::read_cluster(unsigned int)
../../gcc/gcc/cp/module.cc:17519
0xd01b8f module_state::load_section(unsigned int, binding_slot*)
../../gcc/gcc/cp/module.cc:21516
0xd01d6a lazy_load_binding(unsigned int, tree_node*, tree_node*, binding_slot*)
../../gcc/gcc/cp/module.cc:22576
/opt/gcc-master/libexec/gcc/x86_64-pc-linux-gnu/16.0.1/cc1plus -quiet -I
/home/seb/src/mathplot -I /usr/include/hdf5/serial -I /usr/include/freetype2 -I
/home/seb/src/mathplot/maths -I /home/seb/src/mathplot/json/include -I
/home/seb/src/mathplot/include/rapidxml-1.13 -imultiarch x86_64-linux-gnu -MD
bugrep/CMakeFiles/cmap.dir/__/mplot/ColourMap.cppm.d -MF
bugrep/CMakeFiles/cmap.dir/__/mplot/ColourMap.cppm.o.d -MT
bugrep/CMakeFiles/cmap.dir/__/mplot/ColourMap.cppm.o -D_GNU_SOURCE -D_REENTRANT
-D MPLOT_HAVE_STD_FORMAT -D MPLOT_FONTS_DIR="/home/seb/src/mathplot/fonts"
/home/seb/src/mathplot/mplot/ColourMap.cppm
-fdeps-file=bugrep/CMakeFiles/cmap.dir/__/mplot/ColourMap.cppm.ddi
-fdeps-target=bugrep/CMakeFiles/cmap.dir/__/mplot/ColourMap.cppm.o -quiet
-dumpdir bugrep/CMakeFiles/cmap.dir/__/mplot/ -dumpbase ColourMap.cppm.cppm
-dumpbase-ext .cppm -mtune=generic -march=x86-64 -g -O3 -Wall -Wextra
-Wpedantic -pedantic-errors -Werror -Wfatal-errors -Wno-psabi -std=gnu++23
-fconstexpr-ops-limit=5000000000 -fopenmp -freport-bug -fmodules
-fmodule-mapper=bugrep/CMakeFiles/cmap.dir/__/mplot/ColourMap.cppm.o.modmap
-fdeps-format=p1689r5 -o /tmp/ccpqjBae.s
Please submit a full bug report, with preprocessed source.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
Preprocessed source stored into /tmp/cco7luXA.out file, please attach this to
your bugreport.
ninja: build stopped: subcommand failed.