This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: .macro bug in gas for IA64


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]