This is the mail archive of the gcc-patches@gcc.gnu.org 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]

Re: Some syntactic sugar for machine descriptions


On Thu, Jun 28, 2001 at 07:32:26PM -0700, Richard Henderson wrote:
> On Thu, Jun 28, 2001 at 06:15:25PM -0700, Zack Weinberg wrote:
> > > Pretty sure you want a return here.  We're not supposed
> > > to put the newline on the obstack, are we?
> > 
> > The old code did.
> 
> True, it does.  But archaeology suggests that was by oversight rather
> than by intention.  IMO we should either support \\\n as one might
> expect -- line concatenation -- or not support it at all. 

That will break i860.md, which has code like this:

      return \"frcp.dd %2,%3\;fmul.dd %2,%3,%0\;fmov.dd %?f0,%4\;\\\
orh 0x4000,%?r0,%?r31\;...

Note the triple backslash.  Right now, that will translate to

      return "frcp.dd %2,%3\n\tfmul.dd %2,%3,%0\n\tfmov.dd %?f0,%4\n\t\
orh 0x4000,%?r0,%?r31\n\t...

in insn-output.c, but if \-newline executes a line concatenation, it
will become

      return "...fmov.dd %?f0,%4\n\t\orh 0x4000,%?r0,%?r31\n\t...

which has an invalid escape (\o) in it.

The only other machine descriptions that match /\\$/ are mips.md,
which uses only double backslash and won't be affected, and ns32k.md,
which appears to be a harmless typo.  I suppose I could change
i860.md, but I have no way of testing it.

-- 
zw                I'm on a spaceship full of college students.
                  	-- Martin "PCHammer" Rose


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