RISC-V: Fix ICE of visiting non-existing block in CFG.
authorJu-Zhe Zhong <juzhe.zhong@rivai.ai>
Sat, 24 Dec 2022 03:08:00 +0000 (11:08 +0800)
committerKito Cheng <kito.cheng@sifive.com>
Tue, 27 Dec 2022 15:29:24 +0000 (23:29 +0800)
commit681a5632e0afaa24cc2a3d50a30be08d27dbfd35
treefdd8a5fd752d14b0fdccc3dfa9e5082df17fc2de
parent12b23c718cd29924a18e8cdd6790a9c04801c5f5
RISC-V: Fix ICE of visiting non-existing block in CFG.

This patch is to fix issue of visiting non-existing block of CFG.
Since blocks index of CFG in GCC are not always contiguous, we will potentially
visit a gap block which is no existing in the current CFG.

This patch can avoid visiting non existing block in CFG.

I noticed such issue in my internal regression of current testsuite
when I change the X86 server machine. This patch fix it:
17:27:15      job(build_and_test_rv32): Increased FAIL List:
17:27:15      job(build_and_test_rv32): FAIL: gcc.target/riscv/rvv/vsetvl/vlmax_back_prop-46.c
-O2 -flto -fno-use-linker-plugin -flto-partition=none  (internal compiler error: Segmentation fault)

gcc/ChangeLog:

* config/riscv/riscv-vsetvl.cc
(pass_vsetvl::compute_global_backward_infos): Change to visit CFG.
(pass_vsetvl::prune_expressions): Ditto.
gcc/config/riscv/riscv-vsetvl.cc