aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/backend/rust-constexpr.cc
diff options
context:
space:
mode:
authorxuli <xuli1@eswincomputing.com>2023-09-28 01:29:12 +0000
committerxuli <xuli1@eswincomputing.com>2023-09-28 01:30:37 +0000
commit110ffb2d8d3a64b32dd56ac995c2e30e8f64d4dc (patch)
tree7a3258bffc244bc6143f1d333cbebf8e76868cb3 /gcc/rust/backend/rust-constexpr.cc
parent1fab05a885a308c19cf42b72fd36805ddf27fdc8 (diff)
downloadgcc-110ffb2d8d3a64b32dd56ac995c2e30e8f64d4dc.zip
gcc-110ffb2d8d3a64b32dd56ac995c2e30e8f64d4dc.tar.gz
gcc-110ffb2d8d3a64b32dd56ac995c2e30e8f64d4dc.tar.bz2
RISC-V: Bugfix for RTL check[PR111533]
Consider the flowing situation: BB5: local_dem(RVV Insn 1, AVL(reg zero)) RVV Insn 1: vmv.s.x, AVL (const_int 1) RVV Insn 2: vredsum.vs, AVL(reg zero) vmv.s.x has vl operand, the following code will get avl (cosnt_int) from RVV Insn 1. rtx avl = has_vl_op (insn->rtl ()) ? get_vl (insn->rtl ()) : dem.get_avl (); If use REGNO for const_int, the compiler will crash: during RTL pass: vsetvl res_debug.c: In function '__dn_count_labels': res_debug.c:1050:1: internal compiler error: RTL check: expected code 'reg', have 'const_int' in rhs_regno, at rtl.h:1934 1050 | } | ^ 0x8fb169 rtl_check_failed_code1(rtx_def const*, rtx_code, char const*, int, char const*) ../.././gcc/gcc/rtl.cc:770 0x1399818 rhs_regno(rtx_def const*) ../.././gcc/gcc/rtl.h:1934 0x1399818 anticipatable_occurrence_p ../.././gcc/gcc/config/riscv/riscv-vsetvl.cc:348 So in this case avl should be obtained from dem. Another issue is caused by the following code: HOST_WIDE_INT diff = INTVAL (builder.elt (i)) - i; during RTL pass: expand ../../.././gcc/libgfortran/generated/matmul_c4.c: In function 'matmul_c4': ../../.././gcc/libgfortran/generated/matmul_c4.c:2906:39: internal compiler error: RTL check: expected code 'const_int', have 'const_poly_int' in expand_const_vector, at config/riscv/riscv-v.cc:1149 The builder.elt (i) can be either const_int or const_poly_int. PR target/111533 gcc/ChangeLog: * config/riscv/riscv-v.cc (expand_const_vector): Fix bug. * config/riscv/riscv-vsetvl.cc (anticipatable_occurrence_p): Fix bug. gcc/testsuite/ChangeLog: * gcc.target/riscv/rvv/base/pr111533-1.c: New test. * gcc.target/riscv/rvv/base/pr111533-2.c: New test.
Diffstat (limited to 'gcc/rust/backend/rust-constexpr.cc')
0 files changed, 0 insertions, 0 deletions