This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: S/390: Some cleanup
- From: "Zack Weinberg" <zack at codesourcery dot com>
- To: Ulrich Weigand <weigand at i1 dot informatik dot uni-erlangen dot de>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Thu, 31 Jul 2003 10:55:33 -0700
- Subject: Re: S/390: Some cleanup
- References: <200307311715.TAA11616@faui11.informatik.uni-erlangen.de>
Ulrich Weigand <weigand@i1.informatik.uni-erlangen.de> writes:
> Zack Weinberg wrote:
>
>> You can remove the extra backslash in "\\t", too, e.g.
>>
>> > ! case 0: return "tmhh\\t%0,%x2";
>>
>> can be written "tmhh\t%0,%x2"
>
> Hmm, I left those in because I have the double-backslash
> also in all 'normal' output strings ...
>
> From checking other backends I now gather that this would
> be superfluous as well, right? What exactly are the
> quoting rules in output strings?
Strings in .md files obey the same syntax rules as C strings, except
they're allowed to extend over multiple lines. "tmhh\t%0,%x2" --
either on its own, or as part of a brace block -- will be passed
through verbatim to insn-output.c and interpreted by the C compiler.
"tmhh\\t%0,%x2" also translates to "tmhh\t%0,%x2" in insn-output.c,
because read-rtl.c will eat the first backslash. (I think this means
if you want a literal backslash or quotation mark in your assembly
output template, you're hosed, but fortunately no one cares to do
that.)
"* return \"tmhh\\t%0,%x2\";" is equivalent to
{ return "tmhh\t%0,%x2"; } -- in the first case, however, the extra
backslashes *are* necessary, to prevent the reader from ending the
string too soon. I invented the brace block notation precisely so
that people could stop using \\ and \" all over the place in their
output logic.
zw