This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: .macro bug in gas for IA64
- From: Nick Clifton <nickc at redhat dot com>
- To: connors at hpltsc dot hpl dot hp dot com
- Cc: wilson at tuliptree dot org, binutils at sources dot redhat dot com
- Date: 06 Mar 2003 11:22:48 +0000
- Subject: Re: .macro bug in gas for IA64
- References: <20030228192223.A5158@hpltsc.hpl.hp.com>
Hi Tim,
> I've come across a bug in the assembler (binutils-2.13) for IA64. I
> have a solution and I'm looking for feedback as to whether it is
> palatable. (And if so, a champion to fix it. diffs at the end.)
> Suppose that the stop bit construct (;;) is used in the body of a
> macro definition (.macro). At macro invocation, the stop bit
> construct does not appear in the macro expansion :-(
It seems to me that your proposed patch would disallow multiple
instructions on a single line inside macro blocks (for the IA64 at least).
Instead would it not be easier to choose a different character to be
the line separator character ? Then you would not have to add any new
code, and instead you could just change the initialisation value of
line_separator_chars[] in tc-ia64.c.
If you cannot change the line separator, then at the very least you
ought to change your new macro so that it takes the input line pointer
and then it can scan ahead. ie something like:
while (!is_end_of_line[(unsigned char) *input_line_pointer]
#ifdef md_end_of_line_char
|| ! md_end_of_line_char (input_line_pointer)
#endif
|| (inquote != '\0' && *input_line_pointer != '\n'))
{
...
sb_add_char (line, *input_line_pointer++);
}
...
int
ia64_end_of_line_char (char * ilp)
{
/* ';;' is the stop bit and should not be treated as a line separator. */
return (ilp[0] == ';' && ilp[1] != ';');
}
That way if there is only a single ';' it will be treated as a line
separator, but if there are two, then they will be treated as a stop
bit.
Cheers
Nick