diff mbox

[RFC,AArch64] Define BASE_REG_CLASS to be GENERAL_REGS

Message ID 537456AF.5020204@linaro.org
State Accepted
Headers show

Commit Message

Kugan Vivekanandarajah May 15, 2014, 5:54 a.m. UTC
Hi All,

In AArch64 back-end, BASE_REG_CLASS is defined to be POINTER_REGS.
Shouldn’t this be GENERAL_REGS?

Attached RFC patch makes it GENERAL_REGS. Regression tested for
aarch64-none-linux-gnu on qemu-aarch64 with now new regression. Is this OK ?

Thanks,
Kugan

gcc/
2014-05-15  Kugan Vivekanandarajah  <kuganv@linaro.org>

	* config/aarch64/aarch64.h (BASE_REG_CLASS) : define BASE_REG_CLASS
	to be GENERAL_REGS.

Comments

Marcus Shawcroft May 21, 2014, 3:21 p.m. UTC | #1
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
Richard Earnshaw May 21, 2014, 4:43 p.m. UTC | #2
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 mbox

Patch

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.  */