Skip to content

truncdfhf2.c:52:1: internal compiler error: in as_a, at machmode.h:381 #610

Open
@abrodkin

Description

@abrodkin

On attempt to compile ARC GNU tools for ARC-V using GCC from https://github.com/foss-for-synopsys-dwc-arc-processors/gcc-arcv/commit/97a9f06441fd59c6f87803ded8410536495d145e got the following ICE.

Consider preprocessed input file truncdfhf2.zip and compile it in the following way:

.../riscv32-elf/build/build-cc-gcc-core/./gcc/xgcc -B.../riscv32-elf/build/build-cc-gcc-core/./gcc/ -g -mcmodel=medlow -O2 truncdfhf2.i -c

during RTL pass: vartrack
.../riscv32-elf/src/gcc/libgcc/soft-fp/truncdfhf2.c: In function '__truncdfhf2':
.../riscv32-elf/src/gcc/libgcc/soft-fp/truncdfhf2.c:52:1: internal compiler error: in as_a, at machmode.h:381
   52 | }
      | ^
0xa99b42 scalar_int_mode as_a<scalar_int_mode>(machine_mode)
        .../riscv32-elf/src/gcc/gcc/machmode.h:381
0xa9a05f scalar_int_mode as_a<scalar_int_mode>(machine_mode)
        .../riscv32-elf/src/gcc/gcc/rtl.h:3213
0xa9a05f num_sign_bit_copies1
        .../riscv32-elf/src/gcc/gcc/rtlanal.cc:5476
0x128543e num_sign_bit_copies1
        .../riscv32-elf/src/gcc/gcc/rtlanal.cc:5669
0x1285231 num_sign_bit_copies1
        .../riscv32-elf/src/gcc/gcc/rtlanal.cc:5527
0x12c99c8 simplify_const_relational_operation(rtx_code, machine_mode, rtx_def*, rtx_def*)
        .../riscv32-elf/src/gcc/gcc/simplify-rtx.cc:6380
0x12c386e simplify_context::simplify_relational_operation(rtx_code, machine_mode, machine_mode, rtx_def*, rtx_def*)
        .../riscv32-elf/src/gcc/gcc/simplify-rtx.cc:5830
0x12c2a24 simplify_relational_operation(rtx_code, machine_mode, machine_mode, rtx_def*, rtx_def*)
        .../riscv32-elf/src/gcc/gcc/rtl.h:3508
0x12c2a24 simplify_rtx(rtx_def const*)
        .../riscv32-elf/src/gcc/gcc/simplify-rtx.cc:7998
0xdffdc7 cselib_expand_value_rtx_1
        .../riscv32-elf/src/gcc/gcc/cselib.cc:2128
0xe0105e cselib_expand_value_rtx_cb(rtx_def*, bitmap_head*, int, rtx_def* (*)(rtx_def*, bitmap_head*, int, void*), void*)
        .../riscv32-elf/src/gcc/gcc/cselib.cc:1836
0x165df17 vt_expand_var_loc_chain
        .../riscv32-elf/src/gcc/gcc/var-tracking.cc:8403
0x165e4e8 vt_expand_loc_callback
        .../riscv32-elf/src/gcc/gcc/var-tracking.cc:8566
0xdfffb1 cselib_expand_value_rtx_1
        .../riscv32-elf/src/gcc/gcc/cselib.cc:1988
0xdffd61 cselib_expand_value_rtx_1
        .../riscv32-elf/src/gcc/gcc/cselib.cc:2026
0xe0105e cselib_expand_value_rtx_cb(rtx_def*, bitmap_head*, int, rtx_def* (*)(rtx_def*, bitmap_head*, int, void*), void*)
        .../riscv32-elf/src/gcc/gcc/cselib.cc:1836
0x165df17 vt_expand_var_loc_chain
        .../riscv32-elf/src/gcc/gcc/var-tracking.cc:8403
0x165e4e8 vt_expand_loc_callback
        .../riscv32-elf/src/gcc/gcc/var-tracking.cc:8566
0xdfffb1 cselib_expand_value_rtx_1
        .../riscv32-elf/src/gcc/gcc/cselib.cc:1988
0xe0105e cselib_expand_value_rtx_cb(rtx_def*, bitmap_head*, int, rtx_def* (*)(rtx_def*, bitmap_head*, int, void*), void*)
        .../riscv32-elf/src/gcc/gcc/cselib.cc:1836
Please submit a full bug report, with preprocessed source (by using -freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

For the record the following Crosstool-NG (taken from foss-for-synopsys-dwc-arc-processors/crosstool-ng@963a7fb commit) defconfig was used:

CT_CONFIG_VERSION="4"
CT_EXPERIMENTAL=y
CT_PREFIX_DIR="riscv32-unknown-elf"
# CT_LOG_PROGRESS_BAR is not set
CT_ARCH_RISCV=y
CT_ARCH_TUNE="rocket"
CT_OMIT_TARGET_VENDOR=y
CT_MULTILIB=y
CT_ARCH_ARCH="rv32imafd_zicond_zicsr_zifencei_zihintpause_zfa_zfh_zfhmin_zca_zcb_zcf_zcmp_zcmt_zba_zbb_zbc_zbs"
CT_ARCH_ABI="ilp32d"
CT_TARGET_CFLAGS="-Os -mcmodel=medlow"
# CT_SHOW_CT_VERSION is not set
CT_TOOLCHAIN_PKGVERSION="RISC-V elf toolchain - build 6596"
CT_TARGET_ALIAS="riscv32-elf"
CT_BINUTILS_SRC_DEVEL=y
CT_BINUTILS_DEVEL_URL="https://github.com/foss-for-synopsys-dwc-arc-processors/binutils-gdb"
CT_BINUTILS_DEVEL_REVISION="4183914f8d5307d6b0ffe6a47344e546fab3bdf1"
CT_NEWLIB_SRC_DEVEL=y
CT_NEWLIB_DEVEL_URL="https://github.com/foss-for-synopsys-dwc-arc-processors/newlib"
CT_NEWLIB_DEVEL_REVISION="b6a8d03ce1c807ab8f369e819cc46edfe410cbd4"
CT_LIBC_NEWLIB_TARGET_CFLAGS="-O2 -D_POSIX_MODE -ffunction-sections -fdata-sections -Os -mcmodel=medlow"
CT_LIBC_NEWLIB_IO_C99FMT=y
CT_LIBC_NEWLIB_IO_LL=y
CT_LIBC_NEWLIB_IO_FLOAT=y
CT_LIBC_NEWLIB_IO_LDBL=y
CT_LIBC_NEWLIB_REGISTER_FINI=y
CT_GCC_SRC_DEVEL=y
CT_GCC_DEVEL_URL="[email protected]:foss-for-synopsys-dwc-arc-processors/gcc-arcv.git"
CT_GCC_DEVEL_REVISION="97a9f06441fd59c6f87803ded8410536495d145e"
CT_GCC_V_13=y
CT_CC_GCC_CONFIG_TLS=y
# CT_CC_GCC_USE_GRAPHITE is not set
# CT_CC_GCC_ENABLE_TARGET_OPTSPACE is not set
# CT_CC_GCC_TM_CLONE_REGISTRY is not set
CT_CC_LANG_CXX=y
CT_DEBUG_GDB=y
CT_GDB_SRC_DEVEL=y
CT_GDB_DEVEL_URL="https://sourceware.org/git/binutils-gdb.git"
CT_GDB_DEVEL_REVISION="e53a8e8685685c97588f8319d993ea6cd5635e47"
# CT_GDB_CROSS_PYTHON is not set
CT_COMP_LIBS_NEWLIB_NANO=y
CT_NEWLIB_NANO_SRC_DEVEL=y
CT_NEWLIB_NANO_DEVEL_URL="https://github.com/foss-for-synopsys-dwc-arc-processors/newlib"
CT_NEWLIB_NANO_DEVEL_REVISION="b6a8d03ce1c807ab8f369e819cc46edfe410cbd4"
CT_LIBC_NEWLIB_NANO_TARGET_CFLAGS="-Os -ffunction-sections -fdata-sections -Os -mcmodel=medlow"
# CT_LIBC_NEWLIB_NANO_FVWRITE_IN_STREAMIO is not set
# CT_LIBC_NEWLIB_NANO_MULTITHREAD is not set

Metadata

Metadata

Labels

arc-vIssues related to RISC-V-based ARC-V processorsbugcomponent: gccgeneralIssues related to non-Synopsys coderelease notesItems to mention in release notes

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions