diff options
author | mshawcroft <mshawcroft@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-10-17 16:31:47 +0000 |
---|---|---|
committer | mshawcroft <mshawcroft@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-10-17 16:31:47 +0000 |
commit | e57c0318d97a6b2dd88b717c205d34dbb5c659c7 (patch) | |
tree | e586501a9f265d8156532217107cc8fab6e843fc /gcc/config/aarch64 | |
parent | 0369f7a4c6bdde60320b80c722b63509422f8219 (diff) | |
download | gcc-e57c0318d97a6b2dd88b717c205d34dbb5c659c7.tar.gz |
[AArch64] Fix preferred_reload_class for regclass STACK_REG.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@203778 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/aarch64')
-rw-r--r-- | gcc/config/aarch64/aarch64.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c index da3962f354b..7fce7a05065 100644 --- a/gcc/config/aarch64/aarch64.c +++ b/gcc/config/aarch64/aarch64.c @@ -4219,9 +4219,18 @@ aarch64_class_max_nregs (reg_class_t regclass, enum machine_mode mode) static reg_class_t aarch64_preferred_reload_class (rtx x, reg_class_t regclass) { - if (regclass == POINTER_REGS || regclass == STACK_REG) + if (regclass == POINTER_REGS) return GENERAL_REGS; + if (regclass == STACK_REG) + { + if (REG_P(x) + && reg_class_subset_p (REGNO_REG_CLASS (REGNO (x)), POINTER_REGS)) + return regclass; + + return NO_REGS; + } + /* If it's an integer immediate that MOVI can't handle, then FP_REGS is not an option, so we return NO_REGS instead. */ if (CONST_INT_P (x) && reg_class_subset_p (regclass, FP_REGS) |