From 4f9c5d5c4892e584a42b98f8d8643ce0b7b76490 Mon Sep 17 00:00:00 2001 From: Claudiu Zissulescu Date: Tue, 25 Apr 2017 14:03:40 +0200 Subject: [PATCH] [ARC] Allow extension core registers to be used for addresses. gcc/ 2017-04-25 Claudiu Zissulescu * config/arc/arc.h (REGNO_OK_FOR_BASE_P): Consider also extension core registers. (REG_OK_FOR_INDEX_P_NONSTRICT): Likewise. (REG_OK_FOR_BASE_P_NONSTRICT): Likewise. From-SVN: r247196 --- gcc/ChangeLog | 7 +++++++ gcc/config/arc/arc.h | 20 +++++++++----------- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b38b429f38b..e4b71023b70 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2017-04-25 Claudiu Zissulescu + + * config/arc/arc.h (REGNO_OK_FOR_BASE_P): Consider also extension + core registers. + (REG_OK_FOR_INDEX_P_NONSTRICT): Likewise. + (REG_OK_FOR_BASE_P_NONSTRICT): Likewise. + 2017-04-25 Claudiu Zissulescu * config/arc/arc.c (arc_output_addsi): Check for h-register class diff --git a/gcc/config/arc/arc.h b/gcc/config/arc/arc.h index 1ffb5dec51e..549113070e0 100644 --- a/gcc/config/arc/arc.h +++ b/gcc/config/arc/arc.h @@ -640,7 +640,8 @@ extern enum reg_class arc_regno_reg_class[]; #define REGNO_OK_FOR_BASE_P(REGNO) \ ((REGNO) < 29 || ((REGNO) == ARG_POINTER_REGNUM) || ((REGNO) == 63) \ || ((unsigned) reg_renumber[REGNO] < 29) \ - || ((unsigned) (REGNO) == (unsigned) arc_tp_regno)) + || ((unsigned) (REGNO) == (unsigned) arc_tp_regno) \ + || (fixed_regs[REGNO] == 0 && IN_RANGE (REGNO, 32, 59))) #define REGNO_OK_FOR_INDEX_P(REGNO) REGNO_OK_FOR_BASE_P(REGNO) @@ -922,18 +923,15 @@ extern int arc_initial_elimination_offset(int from, int to); /* Nonzero if X is a hard reg that can be used as an index or if it is a pseudo reg. */ -#define REG_OK_FOR_INDEX_P_NONSTRICT(X) \ -((unsigned) REGNO (X) >= FIRST_PSEUDO_REGISTER || \ - (unsigned) REGNO (X) < 29 || \ - (unsigned) REGNO (X) == 63 || \ - (unsigned) REGNO (X) == ARG_POINTER_REGNUM) +#define REG_OK_FOR_INDEX_P_NONSTRICT(X) \ + ((unsigned) REGNO (X) >= FIRST_PSEUDO_REGISTER \ + || REGNO_OK_FOR_BASE_P (REGNO (X))) + /* Nonzero if X is a hard reg that can be used as a base reg or if it is a pseudo reg. */ -#define REG_OK_FOR_BASE_P_NONSTRICT(X) \ -((unsigned) REGNO (X) >= FIRST_PSEUDO_REGISTER || \ - (unsigned) REGNO (X) < 29 || \ - (unsigned) REGNO (X) == 63 || \ - (unsigned) REGNO (X) == ARG_POINTER_REGNUM) +#define REG_OK_FOR_BASE_P_NONSTRICT(X) \ + ((unsigned) REGNO (X) >= FIRST_PSEUDO_REGISTER \ + || REGNO_OK_FOR_BASE_P (REGNO (X))) /* Nonzero if X is a hard reg that can be used as an index. */ #define REG_OK_FOR_INDEX_P_STRICT(X) REGNO_OK_FOR_INDEX_P (REGNO (X)) -- 2.30.2