https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124466
Bug ID: 124466
Summary: ICE building C++ modules project
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 63909
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=63909&action=edit
Preprocessed source from -freport-bug
ICE building a C++ modules project
Steps to reproduce:
Install prerequisites. On Ubuntu/Debian it's these:
sudo apt install build-essential git wget \
librapidxml-dev ninja-build \
freeglut3-dev libglu1-mesa-dev libxmu-dev libxi-dev \
libglfw3-dev libfreetype-dev
PLUS g++ compiled from master and cmake at least version 3.28.5.
clone mathplot recursively (it has two submodules):
git clone --recurse-submodules [email protected]:sebsjames/mathplot
switch to the dev/modules_gccbz3 branch
cd mathplot
git checkout dev/modules_gccbz3
git submodule update
Build using cmake:
mkdir bgcc
cd bgcc
CC=/path/to/gcc CXX=/path/to/g++ cmake .. -GNinja
ninja helloworld
Error output:
[16:07:45 bgcc] /opt/gcc-master/bin/g++ -freport-bug
-I/home/seb/src/antpov/extern/mathplot -I/usr/include/hdf5/serial
-I/home/seb/src/antpov/extern/mathplot/maths
-I/home/seb/src/antpov/extern/mathplot/json/include
-I/home/seb/src/antpov/extern/mathplot/include/rapidxml-1.13 -isystem
/usr/include/freetype2 -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/antpov/extern/mathplot/fonts\"" -std=c++20
-MD -MT examples/CMakeFiles/helloworld.dir/helloworld.cpp.o -MF
examples/CMakeFiles/helloworld.dir/helloworld.cpp.o.d -fmodules-ts
-fmodule-mapper=examples/CMakeFiles/helloworld.dir/helloworld.cpp.o.modmap -MD
-fdeps-format=p1689r5 -x c++ -o
examples/CMakeFiles/helloworld.dir/helloworld.cpp.o -c
/home/seb/src/antpov/extern/mathplot/examples/helloworld.cpp
/home/seb/src/antpov/extern/mathplot/examples/helloworld.cpp:1:21: internal
compiler error: in operator[], at vec.h:911
1 | import mplot.visual;
| ^
0x2ae693f internal_error(char const*, ...)
../../gcc/gcc/diagnostic-global-context.cc:787
0xb4bef7 fancy_abort(char const*, int, char const*)
../../gcc/gcc/diagnostics/context.cc:1813
0x83e298 vec<tree_node*, va_gc, vl_embed>::operator[](unsigned int)
../../gcc/gcc/vec.h:911
0x841c7c vec<diagnostics::option_classifier::classification_change_t, va_heap,
vl_embed>::operator[](unsigned int)
../../gcc/gcc/cp/module.cc:19270
0x841c7c vec<diagnostics::option_classifier::classification_change_t, va_heap,
vl_ptr>::operator[](unsigned int)
../../gcc/gcc/vec.h:1610
0x841c7c module_state::read_diagnostic_classification(diagnostics::context*)
../../gcc/gcc/cp/module.cc:19272
0xce6656 module_state::read_initial(cpp_reader*)
../../gcc/gcc/cp/module.cc:21283
0xce67f6 module_state::do_import(cpp_reader*, bool)
../../gcc/gcc/cp/module.cc:22430
0xd053a1 direct_import
../../gcc/gcc/cp/module.cc:22650
0xda6134 cp_parser_translation_unit
../../gcc/gcc/cp/parser.cc:5561
0xda6134 c_parse_file()
../../gcc/gcc/cp/parser.cc:57479
0xf39221 c_common_parse_file()
../../gcc/gcc/c-family/c-opts.cc:1422
/opt/gcc-master/libexec/gcc/x86_64-pc-linux-gnu/16.0.1/cc1plus -quiet -I
/home/seb/src/antpov/extern/mathplot -I /usr/include/hdf5/serial -I
/home/seb/src/antpov/extern/mathplot/maths -I
/home/seb/src/antpov/extern/mathplot/json/include -I
/home/seb/src/antpov/extern/mathplot/include/rapidxml-1.13 -imultiarch
x86_64-linux-gnu -MD examples/CMakeFiles/helloworld.dir/helloworld.cpp.d -MF
examples/CMakeFiles/helloworld.dir/helloworld.cpp.o.d -MT
examples/CMakeFiles/helloworld.dir/helloworld.cpp.o -D_GNU_SOURCE -D_REENTRANT
-D MPLOT_HAVE_STD_FORMAT -D
MPLOT_FONTS_DIR="/home/seb/src/antpov/extern/mathplot/fonts" -isystem
/usr/include/freetype2
/home/seb/src/antpov/extern/mathplot/examples/helloworld.cpp
-fdeps-file=examples/CMakeFiles/helloworld.dir/helloworld.cpp.ddi
-fdeps-target=examples/CMakeFiles/helloworld.dir/helloworld.cpp.o -quiet
-dumpdir examples/CMakeFiles/helloworld.dir/ -dumpbase helloworld.cpp.cpp
-dumpbase-ext .cpp -mtune=generic -march=x86-64 -g -O3 -Wall -Wextra -Wpedantic
-pedantic-errors -Werror -Wfatal-errors -Wno-psabi -std=c++20 -freport-bug
-fconstexpr-ops-limit=5000000000 -fopenmp -fmodules
-fmodule-mapper=examples/CMakeFiles/helloworld.dir/helloworld.cpp.o.modmap
-fdeps-format=p1689r5 -o /tmp/cc6Fpf9A.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/cczQZJCE.out file, please attach this to
your bugreport.