This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [patch][GAS] combine NUMBERS_WITH_SUFFIX with LOCAL_LABELS_FB (for z80)
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: Arnold Metselaar <arnold dot metselaar at planet dot nl>
- Cc: binutils at sources dot redhat dot com
- Date: Sat, 5 Nov 2005 23:34:53 +1030
- Subject: Re: [patch][GAS] combine NUMBERS_WITH_SUFFIX with LOCAL_LABELS_FB (for z80)
- References: <200510302104.08328.arnold.metselaar@planet.nl>
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