[PATCH, generic] Support printing of escaped curly braces and vertical bar in assembler output

Segher Boessenkool segher@kernel.crashing.org
Mon Nov 12 01:20:00 GMT 2012


>> There are four in-tree target architectures that already use %|.   
>> I think
>> it would be better if you made these new escapes target-specific.
>
> Escaped curly braces cannot be target-specific since
> do_assembler_dialects() in final.c ignores any % and considers '{' and
> '}' to be alternative delimeters.

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.


Segher



More information about the Gcc-patches mailing list