[PATCH] S12Z: gas: Fix bug when a symbol name was the single letter 'c'.

Nick Clifton nickc@redhat.com
Wed Jan 16 15:45:00 GMT 2019


Hi John,

>      > +	st d0, c 	; c is a valid label
>      How does the assembler know that "c" here is meant to be label c 
>      and not the register c ?
> 
> Because there is no register called "c".  Also a register would be
> semantically incorrect here.

OK, so how about:

  st d0, d1

That is legal, right ?  But if there is also a symbol called "d1"
then what should the assembler do ?  [Answer - choose one, but be
consistent about it...  Also, possibly, issue a warning message].

> It is unfortunate that in this arch the conventional assembler format
> has no syntactical distinction between a register name and a
> symbol name.  Hence, all symbol names are compared against the list of
> register names before use.  Sadly this means the grammar is not context
> free.

Fair enough - patch approved.

Cheers
  Nick




More information about the Binutils mailing list