diff options
author | Dale Johannesen <dalej@apple.com> | 2001-05-18 22:01:54 +0000 |
---|---|---|
committer | Stan Shebs <shebs@gcc.gnu.org> | 2001-05-18 22:01:54 +0000 |
commit | 46fad5b72188e6627c63ce1979375deacfd7bdf6 (patch) | |
tree | e4da3f83a23f5f9a7a7b437a1872a8e997a78eb8 /gcc/config | |
parent | eb47ec1b6974e63d97f315ca0779e75839432182 (diff) | |
download | gcc-46fad5b72188e6627c63ce1979375deacfd7bdf6.zip gcc-46fad5b72188e6627c63ce1979375deacfd7bdf6.tar.gz gcc-46fad5b72188e6627c63ce1979375deacfd7bdf6.tar.bz2 |
rs6000.c (secondary_reload_class): Fix Darwin specific misuse of r0 as a reload address.
2001-05-18 Dale Johannesen <dalej@apple.com>
* config/rs6000/rs6000.c (secondary_reload_class): Fix Darwin
specific misuse of r0 as a reload address.
From-SVN: r42287
Diffstat (limited to 'gcc/config')
-rw-r--r-- | gcc/config/rs6000/rs6000.c | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index 8d2a799..9376b2a 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -3587,17 +3587,22 @@ secondary_reload_class (class, mode, in) { int regno; -#if TARGET_ELF - /* We can not copy a symbolic operand directly into anything other than - BASE_REGS for TARGET_ELF. So indicate that a register from BASE_REGS - is needed as an intermediate register. */ - if (class != BASE_REGS - && (GET_CODE (in) == SYMBOL_REF - || GET_CODE (in) == HIGH - || GET_CODE (in) == LABEL_REF - || GET_CODE (in) == CONST)) - return BASE_REGS; -#endif + if (TARGET_ELF || (DEFAULT_ABI == ABI_DARWIN && flag_pic)) + { + /* We cannot copy a symbolic operand directly into anything + other than BASE_REGS for TARGET_ELF. So indicate that a + register from BASE_REGS is needed as an intermediate + register. + + On Darwin, pic addresses require a load from memory, which + needs a base register. */ + if (class != BASE_REGS + && (GET_CODE (in) == SYMBOL_REF + || GET_CODE (in) == HIGH + || GET_CODE (in) == LABEL_REF + || GET_CODE (in) == CONST)) + return BASE_REGS; + } if (GET_CODE (in) == REG) { |