This is the mail archive of the mailing list for the GCC 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: [PATCH, generic] Support printing of escaped curly braces and vertical bar in assembler output

> There are two parts to it: the actual print_operand thing, that I say
> should be target-specific, since some targets already use those characters
> to mean different things; and of course the assembler dialects code needs
> to be fixed to not choke on escaped versions of the characters it is
> looking for.  I say you can do this second thing without special-casing
> { | }, making it more generic and cleaner and simpler.

>>> For the logic to find the end of an alternative, you can simply always
>>> skip over the next char after any percent sign (well, check for end of
>>> string, of course); there is no need to count percent signs.
>> That would not be a general approach. %% stands for printing percent
>> sign, so in assembler string "{%%}" closing curly brace should be
>> handled as the end of an alternative, though it follows a percent
>> sign.
> The second % is skipped over.

Thanks for the explanation, now I understand it. I fixed the patch
according to your remarks. I removed %| support since we don't
actually need it in i386 right now, it was added for the purpose of
possible generalization.

Updated patch is attached.


2012-11-14  Maxim Kuznetsov  <>

        * final.c (do_assembler_dialects): Don't handle curly braces and
        vertical bar escaped by % as dialect delimiters.
        * config/i386/i386.c (ix86_print_operand_punct_valid_p): Add '{' and
        (ix86_print_operand): Handle '{' and '}'.


2012-11-14  Maxim Kuznetsov  <>

        * New testcase.

Maxim Kuznetsov

Attachment: curly_braces.patch
Description: Binary data

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