Message ID | 537456AF.5020204@linaro.org |
---|---|
State | Accepted |
Headers | show |
On 15 May 2014 06:54, Kugan <kugan.vivekanandarajah@linaro.org> wrote: > Hi All, > > In AArch64 back-end, BASE_REG_CLASS is defined to be POINTER_REGS. > Shouldn’t this be GENERAL_REGS? Hi Kugan, Are you aware of any problem caused by BASE_REG_CLASS being POINTER_REGS? GENERAL_REGS and POINTER_REGS differ only in that the latter includes SP, the former does not. It seems reasonable to me that BASE_REG_CLASS should be based on the set that includes SP...... Cheers /Marcus
On 21/05/14 16:21, Marcus Shawcroft wrote: > On 15 May 2014 06:54, Kugan <kugan.vivekanandarajah@linaro.org> wrote: >> Hi All, >> >> In AArch64 back-end, BASE_REG_CLASS is defined to be POINTER_REGS. >> Shouldn’t this be GENERAL_REGS? > > Hi Kugan, > > Are you aware of any problem caused by BASE_REG_CLASS being POINTER_REGS? > > GENERAL_REGS and POINTER_REGS differ only in that the latter includes > SP, the former does not. It seems reasonable to me that > BASE_REG_CLASS should be based on the set that includes SP...... > > Cheers > /Marcus > Indeed. If you put SP into general regs then you'd need to use a reg-class constraint other than "r" for most instructions (which would break existing inline assembly). If you make BASE_REG_CLASS == GENERAL_REGS you'll probably end up with accesses the stack becoming very inefficient. R.
diff --git a/gcc/config/aarch64/aarch64.h b/gcc/config/aarch64/aarch64.h index 7962aa4..e55cd94 100644 --- a/gcc/config/aarch64/aarch64.h +++ b/gcc/config/aarch64/aarch64.h @@ -448,7 +448,7 @@ enum reg_class #define REGNO_REG_CLASS(REGNO) aarch64_regno_regclass (REGNO) #define INDEX_REG_CLASS CORE_REGS -#define BASE_REG_CLASS POINTER_REGS +#define BASE_REG_CLASS GENERAL_REGS /* Register pairs used to eliminate unneeded registers that point into the stack frame. */