This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: ARM Thumb byte stores
- To: Jonathan Larmour <jlarmour at redhat dot com>
- Subject: Re: ARM Thumb byte stores
- From: Richard Earnshaw <rearnsha at arm dot com>
- Date: Wed, 07 Feb 2001 14:33:51 +0000
- cc: binutils at sources dot redhat dot com, Richard dot Earnshaw at arm dot com
- Organization: ARM Ltd.
- Reply-To: Richard dot Earnshaw at arm dot com
> arm-elf-gcc -mthumb generates the following instruction:
>
> .code 16
> strb r3, [sp]
>
> However this seems to be falling foul of a check in
> gas/config/tc-arm.c:5863:
>
> if (Rb == REG_PC || Rb == REG_SP)
> {
> if (size != THUMB_WORD)
> {
> inst.error = _("byte or halfword not valid for base register");
> return;
> }
>
> The size in this case is obviously THUMB_BYTE, not THUMB_WORD. So is this
> check in gas correct? Or is this a gcc problem. I don't know much about
> Thumb, sorry.
This is a bug in gcc. There is no strb instruction that stores to the
stack in thumb mode. It was fixed (I hope) in the cvs in early December:
2000-12-02 Richard Earnshaw <rearnsha@arm.com>
* arm.h (ARM_REGNO_OK_FOR_BASE_P, THUMB_REGNO_MODE_OK_FOR_BASE_P):
New
macros.
(REGNO_MODE_OK_FOR_BASE_P): Define in terms of above.
(REGNO_OK_FOR_FOR_BASE_P): Delete.
(ARM_REG_OK_FOR_BASE_P, THUMB_REG_MODE_OK_FOR_BASE_P): New macros
for
both strict and non-strict uses.
(REG_MODE_OK_FOR_BASE_P): Define in terms of above.
(ARM_REG_OK_FOR_INDEX_P, THUMB_REG_OK_FOR_INDEX_P): New macros.
(REG_OK_FOR_INDEX_P): Define in terms of above.
(REG_OK_FOR_BASE_P): Delete.
(REG_OK_FOR_PRE_POST_P): Delete.
(ARM_BASE_REGISTER_RTX_P): Renamed from BASE_REGISTER_RTX_P.
(ARM_INDEX_REGISTER_RTX_P): Renamed from INDEX_REGISTER_RTX_P.
(ARM_GO_IF_LEGITIMATE_INDEX): Renamed from GO_IF_LEGITIMATE_INDEX.
(THUMB_LEGITIMATE_OFFSET): Renamed from LEGITIMATE_OFFSET.
(ARM_GO_IF_LEGITIMATE_ADDRESS): Adjust for name changes. Use ARM
specific variants rather than general ones. Use
ARM_REG_OK_FOR_BASE_P
in pre/post increment cases.
(THUMB_GO_IF_LEGITIMATE_ADDRESS): Similarly for Thumb.
(ARM_LEGITIMIZE_ADDRESS): Similarly.
(THUMB_LEGITIMIZE_RELOAD_ADDRESS): Similarly.
* arm.c (legitimate_pic_address): Similarly.