https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111448
Bug ID: 111448 Summary: g++ ICE Segmentation fault in qemu-riscv64-static emulator Product: gcc Version: 13.2.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: rsworktech at outlook dot com Target Milestone: --- Created attachment 55918 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=55918&action=edit reduced ICE source file Maybe this is technically not a gcc bug. But I very much appreciate any suggestions and pointers you might give to me. gcc doesn't fail on real riscv64 boards so looks more like a qemu bug to me. I also reported it to qemu: https://gitlab.com/qemu-project/qemu/-/issues/1895 In a qemu-user Arch Linux riscv64 container(https://github.com/felixonmars/archriscv-packages/wiki/Setup-Arch-Linux-RISC-V-Development-Environment), the attached source file(which has been reduced to less than 5kb by cvise) caused an ICE, segmentation fault. Command: g++ -S testcase.i -w -fpreprocessed -o /dev/null Output: g++: internal compiler error: Segmentation fault signal terminated program cc1plus Please submit a full bug report, with preprocessed source (by using -freport-bug). See <https://bugs.archlinux.org/> for instructions. g++ -v Using built-in specs. COLLECT_GCC=g++ COLLECT_LTO_WRAPPER=/usr/lib/gcc/riscv64-unknown-linux-gnu/13.2.1/lto-wrapper Target: riscv64-unknown-linux-gnu Configured with: /build/gcc/src/gcc/configure --enable-languages=c,c++,d,fortran,go,lto,objc,obj-c++ --enable-bootstrap --prefix=/usr --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=https://bugs.archlinux.org/ --with-build-config=bootstrap-lto --with-linker-hash-style=gnu --with-system-zlib --enable-__cxa_atexit --enable-cet=auto --enable-checking=release --enable-clocale=gnu --enable-default-pie --enable-default-ssp --enable-gnu-indirect-function --enable-gnu-unique-object --enable-libstdcxx-backtrace --enable-link-serialization=1 --enable-linker-build-id --enable-lto --enable-plugin --enable-shared --enable-threads=posix --disable-libssp --disable-libstdcxx-pch --disable-multilib --disable-werror Thread model: posix Supported LTO compression algorithms: zlib zstd gcc version 13.2.1 20230801 (GCC)