diff options
author | Ju-Zhe Zhong <juzhe.zhong@rivai.ai> | 2023-03-05 18:24:30 +0800 |
---|---|---|
committer | Kito Cheng <kito.cheng@sifive.com> | 2023-03-06 01:23:44 +0800 |
commit | 44c918b50af64d1c0f27067b2671e1a4f744841b (patch) | |
tree | 6dfadc20179daf3092dd41049409621be627b8b9 | |
parent | 2554d90c6c2cf80559b918d387944da35fc6aa23 (diff) | |
download | gcc-44c918b50af64d1c0f27067b2671e1a4f744841b.zip gcc-44c918b50af64d1c0f27067b2671e1a4f744841b.tar.gz gcc-44c918b50af64d1c0f27067b2671e1a4f744841b.tar.bz2 |
RISC-V: Fix ICE for avl_single-86/avl_single-88/avl_single-90
If prop is demand of vsetvl instruction and reaching doesn't demand
AVL. We don't backward propagate since vsetvl instruction has no
side effects.
FAIL: gcc.target/riscv/rvv/vsetvl/avl_single-86.c -Og -g (internal
compiler error: Segmentation fault)
FAIL: gcc.target/riscv/rvv/vsetvl/avl_single-86.c -Og -g (test for
excess errors)
FAIL: gcc.target/riscv/rvv/vsetvl/avl_single-88.c -Og -g (internal
compiler error: Segmentation fault)
FAIL: gcc.target/riscv/rvv/vsetvl/avl_single-88.c -Og -g (test for
excess errors)
FAIL: gcc.target/riscv/rvv/vsetvl/avl_single-90.c -Og -g (internal
compiler error: Segmentation fault)
FAIL: gcc.target/riscv/rvv/vsetvl/avl_single-90.c -Og -g (test for
excess errors)
gcc/ChangeLog:
* config/riscv/riscv-vsetvl.cc (reg_available_p): Fix bug.
(pass_vsetvl::backward_demand_fusion): Ditto.
-rw-r--r-- | gcc/config/riscv/riscv-vsetvl.cc | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/gcc/config/riscv/riscv-vsetvl.cc b/gcc/config/riscv/riscv-vsetvl.cc index 9e25102..73f36a7 100644 --- a/gcc/config/riscv/riscv-vsetvl.cc +++ b/gcc/config/riscv/riscv-vsetvl.cc @@ -1528,7 +1528,7 @@ static bool reg_available_p (const bb_info *bb, const vector_insn_info &info) { if (!info.get_avl_source ()) - return true; + return false; insn_info *insn = info.get_avl_source ()->insn (); if (insn->bb () == bb) return before_p (insn, info.get_insn ()); @@ -3040,6 +3040,12 @@ pass_vsetvl::backward_demand_fusion (void) continue; if (e->src->index == ENTRY_BLOCK_PTR_FOR_FN (cfun)->index) continue; + /* If prop is demand of vsetvl instruction and reaching doesn't demand + AVL. We don't backward propagate since vsetvl instruction has no + side effects. */ + if (vsetvl_insn_p (prop.get_insn ()->rtl ()) + && propagate_avl_across_demands_p (prop, block_info.reaching_out)) + continue; if (block_info.reaching_out.unknown_p ()) continue; |