On Mon, Oct 26, 2026 at 5:53 AM <[email protected]> wrote: > > From: Loeka Rogge <[email protected]> > > This was already added in the xtensa backend. Without the check, > reg_renumber[REGNO (x)] >= 0 could dereference null if true_regnum > is called before reload. > > Moved here so it can be reused in the RISC-V backend in the fusion > matchers in riscv-fusion.cc > > Bootstrapped and regtested with all checking enabled on x86. > > gcc/ChangeLog: > > * config/xtensa/xtensa.cc (xt_true_regnum): Removed. > (xtensa_valid_move): Use true_regnum instead of xt version. > (print_operand): Likewise. > (xtensa_secondary_reload): Likewise. > * jump.cc (true_regnum): Replaced by xt version. > > Signed-off-by: Loeka Rogge <[email protected]> > --- > gcc/config/xtensa/xtensa.cc | 48 ++++--------------------------------- > gcc/jump.cc | 14 +++++++---- > 2 files changed, 14 insertions(+), 48 deletions(-)
There are two more places where xt_true_regnum() is used in the xtensa print_operand(), with these fixed the change passes tests for xtensa without regressions and the xtensa part of this change is ok for master. -- Thanks. -- Max
