This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: ARM Thumb byte stores


Hi Jifl,

: 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.

It is a GCC bug.  The STRB instruction in Thumb mode can only take a
"low" register (r0 - r7) as the base address register.  The STR
instruction has an extra mode where it can also use the stack pointer
(SP) as an address register.

What is the source code/command line that is generating this
assembler? 

Cheers
	Nick

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]