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

            Bug ID: 123279
           Summary: [RISC-V] ICE: in code_for_pred_mov, at
                    ./insn-opinit.h:968
           Product: gcc
           Version: 16.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: [email protected]
  Target Milestone: ---
            Target: riscv64-*-*

Created attachment 63137
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=63137&action=edit
Full build log

The build of the ncnn package fails with LTO:

$ /usr/bin/c++  '-xlto' '-c' '-fno-openacc' '-fcf-protection=none' '-g'
'-mabi=lp64d' '-misa-spec=20191213' '-mtls-dialect=trad'
'-march=rv64imafdc_zicsr_zifencei_zmmul_zaamo_zalrsc_zca_zcd' '-O2' '-O2'
'-funwind-tables' '-fasynchronous-unwind-tables' '-fPIC' '-fopenmp'
'-mno-riscv-attribute' '-fPIC' '-O2' '-fstack-protector-strong'
'-funwind-tables' '-fasynchronous-unwind-tables' '-fstack-clash-protection'
'-Werror=return-type' '-g' '-O2' '-g' '-fno-fat-lto-objects' '-shared'
'-save-temps' '-shared-libgcc' '-mabi=lp64d' '-misa-spec=20191213'
'-mtls-dialect=trad'
'-march=rv64imafdc_zicsr_zifencei_zmmul_zaamo_zalrsc_zca_zcd' '-dumpdir'
'libncnn.so.1.0.20251223.' '-dumpbase'
'./libncnn.so.1.0.20251223.ltrans17.ltrans' '-fltrans' '-o'
'./libncnn.so.1.0.20251223.ltrans17.ltrans.o'
'./libncnn.so.1.0.20251223.ltrans17.o'
during RTL pass: expand
/home/abuild/rpmbuild/BUILD/ncnn-20250916-build/ncnn-20250916/src/layer/riscv/convolution_sgemm_packn.h:
In function
'_ZN4ncnnL22im2col_sgemm_packn_rvvERKNS_3MatERS0_S2_S2_RKNS_6OptionE._omp_fn.0':
/home/abuild/rpmbuild/BUILD/ncnn-20250916-build/ncnn-20250916/src/layer/riscv/convolution_sgemm_packn.h:62:63:
internal compiler error: in code_for_pred_mov, at ./insn-opinit.h:968
   62 |                   vfloat32m1_t _val0 = __riscv_vle32_v_f32m1(img0, vl);
      |                                                             ^
0x2a67a9b ???
        ../../gcc/diagnostic-global-context.cc:787
0x852567 ???
        ../../gcc/diagnostics/context.cc:1805
0x8446f9 code_for_pred_mov(machine_mode)
       
/usr/src/debug/gcc-16.0.0+git6314/obj-riscv64-suse-linux/gcc/insn-opinit.h:968
0x13d79ad code_for_pred_mov(machine_mode)
        ../../gcc/tree.h:3915
0x13d79ad riscv_vector::loadstore<false, (riscv_vector::lst_type)0,
false>::expand(riscv_vector::function_expander&) const
        ../../gcc/config/riscv/riscv-vector-builtins-bases.cc:321
0x13d132b riscv_vector::function_expander::expand()
        ../../gcc/config/riscv/riscv-vector-builtins.h:671
0x13d132b riscv_vector::expand_builtin(unsigned int, tree_node*, rtx_def*)
        ../../gcc/config/riscv/riscv-vector-builtins.cc:5524
0xa466e1 expand_expr_real_1(tree_node*, rtx_def*, machine_mode,
expand_modifier, rtx_def**, bool)
        ../../gcc/expr.cc:12644
0xa547f3 store_expr(tree_node*, rtx_def*, int, bool, bool)
        ../../gcc/expr.cc:6791
0xa57aa9 expand_assignment(tree_node*, tree_node*, bool)
        ../../gcc/expr.cc:6487
0x929d9b expand_call_stmt
        ../../gcc/cfgexpand.cc:3203
0x929d9b expand_gimple_stmt_1
        ../../gcc/cfgexpand.cc:4236
0x929d9b expand_gimple_stmt
        ../../gcc/cfgexpand.cc:4383
0x92bdcb expand_gimple_basic_block
        ../../gcc/cfgexpand.cc:6502
0x92dd1b ???
        ../../gcc/cfgexpand.cc:7249

Reply via email to