From: Claudiu Zissulescu Date: Tue, 29 Dec 2020 11:30:05 +0000 (+0200) Subject: arc: Make use reg_renumber safe. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5ccd07e3299b4e01d1899894412bfad798577350;p=gcc.git 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 --- 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))