https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114160
Bug ID: 114160
Summary: ICE in dwarf2out_frame_debug_cfa_offset RISCV
thead-c906
Product: gcc
Version: 13.2.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: target
Assignee: unassigned at gcc dot gnu.org
Reporter: nop at unearthly dot dev
Target Milestone: ---
Created attachment 57573
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57573&action=edit
cvise produced reproduction case
Taking out -O2, -mcpu, or -fPIC out resolves the issue. Additionally, this
doesn't happen on -mtune=thead-c906
This does not happen on gcc 14
mu-loong ~ # gcc -v -O2 -mcpu=thead-c906 -fPIC GBZ.c
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/riscv64-unknown-linux-gnu/13/lto-wrapper
Target: riscv64-unknown-linux-gnu
Configured with:
/var/tmp/portage/sys-devel/gcc-13.2.1_p20240210/work/gcc-13-20240210/configure
--host=riscv64-unknown-linux-gnu --build=riscv64-unknown-linux-gnu
--prefix=/usr --bindir=/usr/riscv64-unknown-linux-gnu/gcc-bin/13
--includedir=/usr/lib/gcc/riscv64-unknown-linux-gnu/13/include
--datadir=/usr/share/gcc-data/riscv64-unknown-linux-gnu/13
--mandir=/usr/share/gcc-data/riscv64-unknown-linux-gnu/13/man
--infodir=/usr/share/gcc-data/riscv64-unknown-linux-gnu/13/info
--with-gxx-include-dir=/usr/lib/gcc/riscv64-unknown-linux-gnu/13/include/g++-v13
--disable-silent-rules --disable-dependency-tracking
--with-python-dir=/share/gcc-data/riscv64-unknown-linux-gnu/13/python
--enable-languages=c,c++,fortran --enable-obsolete --enable-secureplt
--disable-werror --with-system-zlib --enable-nls --without-included-gettext
--disable-libunwind-exceptions --enable-checking=release
--with-bugurl=https://bugs.gentoo.org/ --with-pkgversion='Gentoo
13.2.1_p20240210 p13' --with-gcc-major-version-only --enable-libstdcxx-time
--enable-lto --disable-libstdcxx-pch --enable-shared --enable-threads=posix
--enable-__cxa_atexit --enable-clocale=gnu --disable-multilib
--disable-fixed-point --with-abi=lp64d --disable-libgomp --disable-libssp
--disable-libada --disable-cet --disable-systemtap
--disable-valgrind-annotations --disable-vtable-verify --disable-libvtv
--with-zstd --without-isl --enable-default-pie --enable-default-ssp
--disable-fixincludes
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 13.2.1 20240210 (Gentoo 13.2.1_p20240210 p13)
COLLECT_GCC_OPTIONS='-v' '-O2' '-mcpu=thead-c906' '-fPIC'
'-march=rv64imafdc_zicsr_xtheadba_xtheadbb_xtheadbs_xtheadcmo_xtheadcondmov_xtheadfmemidx_xtheadmac_xtheadmemidx_xtheadmempair_xtheadsync'
'-mabi=lp64d' '-misa-spec=20191213'
'-march=rv64imafdc_zicsr_xtheadba_xtheadbb_xtheadbs_xtheadcmo_xtheadcondmov_xtheadfmemidx_xtheadmac_xtheadmemidx_xtheadmempair_xtheadsync'
'-dumpdir' 'a-'
/usr/libexec/gcc/riscv64-unknown-linux-gnu/13/cc1 -quiet -v -imultilib . GBZ.c
-quiet -dumpdir a- -dumpbase GBZ.c -dumpbase-ext .c -mcpu=thead-c906
-march=rv64imafdc_zicsr_xtheadba_xtheadbb_xtheadbs_xtheadcmo_xtheadcondmov_xtheadfmemidx_xtheadmac_xtheadmemidx_xtheadmempair_xtheadsync
-mabi=lp64d -misa-spec=20191213
-march=rv64imafdc_zicsr_xtheadba_xtheadbb_xtheadbs_xtheadcmo_xtheadcondmov_xtheadfmemidx_xtheadmac_xtheadmemidx_xtheadmempair_xtheadsync
-O2 -version -fPIC -o /tmp/cczMFA4n.s
GNU C17 (Gentoo 13.2.1_p20240210 p13) version 13.2.1 20240210
(riscv64-unknown-linux-gnu)
compiled by GNU C version 13.2.1 20240210, GMP version
6.3.0, MPFR version 4.2.1, MPC version 1.3.1, isl version none
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring nonexistent directory "/usr/local/include"
ignoring nonexistent directory
"/usr/lib/gcc/riscv64-unknown-linux-gnu/13/include-fixed"
ignoring nonexistent directory
"/usr/lib/gcc/riscv64-unknown-linux-gnu/13/../../../../riscv64-unknown-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
/usr/lib/gcc/riscv64-unknown-linux-gnu/13/include
/usr/include
End of search list.
Compiler executable checksum: e5bb685f082cf8fc728c5e3c357fe251
GBZ.c:9:1: warning: no semicolon at end of struct or union
9
| } __libc_message(char *fmt, ...) {
| ^
during RTL pass: dwarf2
GBZ.c: In function ‘__libc_message’:
GBZ.c:19:1: internal compiler error: in dwarf2out_frame_debug_cfa_offset, at
dwarf2cfi.cc:1376
19 | }
| ^
0x40c4e9 dwarf2out_frame_debug_cfa_offset
/usr/src/debug/sys-devel/gcc-13.2.1_p20240210/gcc-13-20240210/gcc/dwarf2cfi.cc:1376
0x40c4e9 dwarf2out_frame_debug
/usr/src/debug/sys-devel/gcc-13.2.1_p20240210/gcc-13-20240210/gcc/dwarf2cfi.cc:2285
0x40c4e9 scan_insn_after
/usr/src/debug/sys-devel/gcc-13.2.1_p20240210/gcc-13-20240210/gcc/dwarf2cfi.cc:2726
0x40d197 scan_trace
/usr/src/debug/sys-devel/gcc-13.2.1_p20240210/gcc-13-20240210/gcc/dwarf2cfi.cc:2893
0x40d4c3 create_cfi_notes
/usr/src/debug/sys-devel/gcc-13.2.1_p20240210/gcc-13-20240210/gcc/dwarf2cfi.cc:2933
0x40d4c3 execute_dwarf2_frame
/usr/src/debug/sys-devel/gcc-13.2.1_p20240210/gcc-13-20240210/gcc/dwarf2cfi.cc:3309
0x40d4c3 execute
/usr/src/debug/sys-devel/gcc-13.2.1_p20240210/gcc-13-20240210/gcc/dwarf2cfi.cc:3799