From 5ccd07e3299b4e01d1899894412bfad798577350 Mon Sep 17 00:00:00 2001 From: Claudiu Zissulescu Date: Tue, 29 Dec 2020 13:30:05 +0200 Subject: [PATCH] arc: Make use reg_renumber safe. The REGNO_OK_FOR_BASE_P is using reg_renumber array. However, it is not always defined. Use it only when it is defined. gcc/ 2020-12-29 Claudiu Zissulescu * config/arc/arc.h (REGNO_OK_FOR_BASE_P): Check if defined reg_renumber. Signed-off-by: Claudiu Zissulescu --- gcc/config/arc/arc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/config/arc/arc.h b/gcc/config/arc/arc.h index fd6e21adfaa..c3886330f1b 100644 --- a/gcc/config/arc/arc.h +++ b/gcc/config/arc/arc.h @@ -588,7 +588,7 @@ extern enum reg_class arc_regno_reg_class[]; || ((REGNO) == ARG_POINTER_REGNUM) \ || ((REGNO) == FRAME_POINTER_REGNUM) \ || ((REGNO) == PCL_REG) \ - || ((unsigned) reg_renumber[REGNO] < 29) \ + || (reg_renumber && ((unsigned) reg_renumber[REGNO] < 29)) \ || ((unsigned) (REGNO) == (unsigned) arc_tp_regno) \ || (fixed_regs[REGNO] == 0 && IN_RANGE (REGNO, 32, 59)) \ || (fixed_regs[REGNO] == 0 && (REGNO) == R30_REG)) -- 2.30.2