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

            Bug ID: 115206
           Summary: ICE: segfault in code involving C++ modules,
                    std::format and std::println
           Product: gcc
           Version: 14.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: sentabel at gmail dot com
  Target Milestone: ---

Created attachment 58279
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=58279&action=edit
produced with -freport-bug

This is a segfault I encountered when working through some code exercises from
Marc Gregoire's 6th edition Professional C++ book. I have attached the output
of -freport-bug as a text file.

The offending compile command from my CMake invocation seems to be as follows:
/opt/homebrew/bin/g++-14   -Wall -Wextra -fno-strict-aliasing -fwrapv
-fno-aggressive-loop-optimizations -D_GLIBCXX_ASSERTIONS -D_GLIBCXX_DEBUG
-save-temps -freport-bug -O3 -DNDEBUG -std=gnu++23 -arch arm64 -isysroot
/Library/Developer/CommandLineTools/SDKs/MacOSX14.4.sdk -MD -MT
Chapter2/CMakeFiles/KeyValue.dir/KeyValueClass.cxx.o -MF
Chapter2/CMakeFiles/KeyValue.dir/KeyValueClass.cxx.o.d -fmodules-ts
-fmodule-mapper=Chapter2/CMakeFiles/KeyValue.dir/KeyValueClass.cxx.o.modmap -MD
-fdeps-format=p1689r5 -x c++ -o
Chapter2/CMakeFiles/KeyValue.dir/KeyValueClass.cxx.o -c
/Users/abelsen/Documents/Professional_CPP_Sixth_Edition_Exercises_Solutions/Chapter2/KeyValueClass.cxx

The output of g++-14 -v on my Mac is as follows:
Using built-in specs.
COLLECT_GCC=g++-14
COLLECT_LTO_WRAPPER=/opt/homebrew/Cellar/gcc/14.1.0/bin/../libexec/gcc/aarch64-apple-darwin23/14/lto-wrapper
Target: aarch64-apple-darwin23
Configured with: ../configure --prefix=/opt/homebrew/opt/gcc
--libdir=/opt/homebrew/opt/gcc/lib/gcc/current --disable-nls
--enable-checking=release --with-gcc-major-version-only
--enable-languages=c,c++,objc,obj-c++,fortran --program-suffix=-14
--with-gmp=/opt/homebrew/opt/gmp --with-mpfr=/opt/homebrew/opt/mpfr
--with-mpc=/opt/homebrew/opt/libmpc --with-isl=/opt/homebrew/opt/isl
--with-zstd=/opt/homebrew/opt/zstd --with-pkgversion='Homebrew GCC 14.1.0'
--with-bugurl=https://github.com/Homebrew/homebrew-core/issues
--with-system-zlib --build=aarch64-apple-darwin23
--with-sysroot=/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.1.0 (Homebrew GCC 14.1.0)

Please let me know if there's any additional information I could provide to
make debugging this issue simpler.

Reply via email to