]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
RISC-V: Minor fix for max_point
authordemin.han <demin.han@starfivetech.com>
Mon, 1 Apr 2024 08:20:46 +0000 (16:20 +0800)
committerdemin.han <demin.han@starfivetech.com>
Mon, 8 Apr 2024 06:13:42 +0000 (14:13 +0800)
The program points start from 1, so max_point should be equal to
length().

Tested on RV64 and no regression.

gcc/ChangeLog:

* config/riscv/riscv-vector-costs.cc: Use length()

Signed-off-by: demin.han <demin.han@starfivetech.com>
gcc/config/riscv/riscv-vector-costs.cc

index f462c272a6e5918f98d51859ea0cc57fb03d94eb..5ceb313c118ad34c3001aa5f3982da26bba41aef 100644 (file)
@@ -752,7 +752,7 @@ update_local_live_ranges (
 
                We will be likely using one more vector variable.  */
              unsigned int max_point
-               = (*program_points_per_bb.get (bb)).length () - 1;
+               = (*program_points_per_bb.get (bb)).length ();
              auto *live_ranges = live_ranges_per_bb.get (bb);
              bool existed_p = false;
              tree var = type == load_vec_info_type