Skip to content
Snippets Groups Projects
Commit cc217a1e authored by Robin Dapp's avatar Robin Dapp
Browse files

RISC-V: Use biggest_mode as mode for constants.

In compute_nregs_for_mode we expect that the current variable's mode is
at most as large as the biggest mode to be used for vectorization.

This might not be true for constants as they don't actually have a mode.
In that case, just use the biggest mode so max_number_of_live_regs
returns 1.

This fixes several test cases in the test suite.

gcc/ChangeLog:

	PR target/116655

	* config/riscv/riscv-vector-costs.cc (max_number_of_live_regs):
	Use biggest mode instead of constant's saved mode.

gcc/testsuite/ChangeLog:

	* gcc.target/riscv/rvv/autovec/pr116655.c: New test.
parent f9bac238
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