From patchwork Mon Jan 28 10:06:16 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: RFA: RL78: Allow SP to be used as a base register Date: Mon, 28 Jan 2013 00:06:16 -0000 From: Nick Clifton X-Patchwork-Id: 216152 Message-Id: <87k3qxhbaf.fsf@redhat.com> To: dj@redhat.com Cc: gcc-patches@gcc.gnu.org Hi DJ, Please may I apply the patch below. It fixes the RL78 backend so that the stack register can be used as a base address register. Tested with no regressions on an rl78-elf toolchain. Cheers Nick PS. I am currently investigating allow r8-r15 to be used as base registers. gcc/ChangeLog 2013-01-28 Nick Clifton * config/rl78/rl78.c (rl78_regno_mode_code_ok_for_base_p): Allow SP_REG. Index: gcc/config/rl78/rl78.c =================================================================== --- gcc/config/rl78/rl78.c (revision 195461) +++ gcc/config/rl78/rl78.c (working copy) @@ -769,7 +769,7 @@ addr_space_t address_space ATTRIBUTE_UNUSED, int outer_code ATTRIBUTE_UNUSED, int index_code) { - if (regno < 24 && regno >= 16) + if (regno <= SP_REG && regno >= 16) return true; if (index_code == REG) return (regno == HL_REG);