Why does arm-*-as issue a warning for "strb r3, [r3], #1"?

Josh Conner jconner@apple.com
Fri Jun 24 21:27:00 GMT 2005


> Hi,
>
> When I feed "strb r3, [r3], #1" to arm-*-as, the assembler issues a
> warning
>
>   "source register same as write-back base"
>
> While I like helpful warnings in general, I am wondering if the
> assembler should issue a warning for something a little strange but
> otherwise correct because a compiler, a major user of the assembler,
> tries to get most out of the instruction set (modulo "discouraged"
> instructions).  Note that gcc's testsuite treats a warning from the
> assembler as FAIL.  (As far as I can tell from the instruction set
> manual, I don't see anything that bans "strb r3, [r3], #1".)
>
> I am tempted to submit a patch to remove this warning from tc-arm.c,
> but I am no expert on ARM.
>
> In case you are wondering, this instruction comes from
> gcc.c-torture/compile/930210-1.c.
>
> Thoughts?
>
> Kazu Hirata

Kazu -

You may also wish to have a look at a bug I filed against GCC for  
this a while back, PR 20972.

- Josh



More information about the Binutils mailing list