Skip to content
Snippets Groups Projects
Commit a2d12abe authored by Ju-Zhe Zhong's avatar Ju-Zhe Zhong Committed by Kito Cheng
Browse files

RISC-V: Fix wrong check of register occurrences [PR109535]


count_occurrences will conly count same RTX (same code and same mode),
but what we want to track is the occurrence of a register, a register
might appeared in the insn with different mode or contain in SUBREG.

Testcase coming from Kito.

gcc/ChangeLog:

	PR target/109535
	* config/riscv/riscv-vsetvl.cc (count_regno_occurrences): New function.
	(pass_vsetvl::cleanup_insns): Fix bug.

gcc/testsuite/ChangeLog:

	PR target/109535
	* g++.target/riscv/rvv/base/pr109535.C: New test.
	* gcc.target/riscv/rvv/base/pr109535.c: New test.

Signed-off-by: default avatarJu-Zhe Zhong <juzhe.zhong@rivai.ai>
Co-authored-by: default avatarkito-cheng <kito.cheng@sifive.com>
parent 98ebdda3
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment