This is the mail archive of the gas2@sourceware.cygnus.com mailing list for the gas2 project.


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

Re: ASM_COMMENT_START and gas divide operator


Alan Modra wrote:
> 
> There is a problem with using "/" to start comments, such as those
> emitted by gcc's -fverbose-asm.  If gas needs to support "/" meaning
> the start of a comment anywhere on a line, then the gas division
> operator is killed, sometimes silently.  For instance:
>   asm("pushl $FOO/2")
> is treated as if the programmer wrote
>   asm("pushl $FOO")
> 
> Of course, this is only a problem with hand-coded assembly, but it
> would be nice to fix gas and gcc.  At least on linux, where the only
> assembler used with gcc is gas, we should be able to make the
> following change without causing too many problems.
> 

I would suggest hacking gas to treat '/' as the comment _only_ when it
is the first character in the line. This does not break gcc/egcs and
does not interfere with the division operator or the opcode prefix
separator syntax.

Martynas