[patch][GAS] combine NUMBERS_WITH_SUFFIX with LOCAL_LABELS_FB (for z80)
Alan Modra
amodra@bigpond.net.au
Sat Nov 5 13:04:00 GMT 2005
On Sun, Oct 30, 2005 at 10:04:08PM +0200, Arnold Metselaar wrote:
> The patch below allows the usage of backward references on
> targets with NUMBERS_WITH_SUFFIX. If NUMBERS_WITH_SUFFIX and
> LOCAL_LABELS_FB are both defined as 1, then suffix 'B'
> indicates a binary number and suffix 'b' indicates a backward
> reference to a local numeric label.
> The Z80 target is currently the only one that has both
> NUMBERS_WITH_SUFFIX and LOCAL_LABELS_FB.
You neglect to mention that this block of code is entered for
flag_m68k_mri as well as NUMBERS_WITH_SUFFIX. (LOCAL_LABELS_FB isn't
defined in tc-m68k.h, but might be defined by one of the te- files,
eg. it will be defined for m68k-linux.) I think you might want
- if (c == 'B')
+ /* If we have both NUMBERS_WITH_SUFFIX and LOCAL_LABELS_FB,
+ we distinguish between 'B' and 'b'. This is the case for
+ Z80. */
+ if ((NUMBERS_WITH_SUFFIX && LOCAL_LABELS_FB ? *suffix : c) == 'B')
With that change, I guess this is a reasonable hack and OK to apply.
BTW, at first I read your changelog entry to mean "Don't match 'B' as
binary suffix when !LOCAL_LABELS_FB". I think the following is
clearer:
gas/
* expr.c (integer_constant): Only match 'B' as binary suffix if
NUMBERS_WITH_SUFFIX and LOCAL_LABELS_FB. Allow both 'b' and 'B'
otherwise.
and the testsuite entries should have paths relative to their ChangeLog
file, ie.
gas/testsuite/
* gas/z80/z80.exp: Added "suffix" test.
* gas/z80/suffix.s: New file.
* gas/z80/suffix.d: New file.
--
Alan Modra
IBM OzLabs - Linux Technology Centre
More information about the Binutils
mailing list