diff --git a/src/amd/compiler/aco_register_allocation.cpp b/src/amd/compiler/aco_register_allocation.cpp index ec8838d97ed..8370effdbc3 100644 --- a/src/amd/compiler/aco_register_allocation.cpp +++ b/src/amd/compiler/aco_register_allocation.cpp @@ -1365,7 +1365,7 @@ void register_allocation(Program *program, std::vector> live_out_ } /* fill in sgpr_live_in */ - for (unsigned i = 0; i < ctx.max_used_sgpr; i++) + for (unsigned i = 0; i <= ctx.max_used_sgpr; i++) sgpr_live_in[block.index][i] = register_file[i]; sgpr_live_in[block.index][127] = register_file[scc.reg];