This is the mail archive of the gcc@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]
Other format: [Raw text]

Re: MS/CW-style inline assembly for GCC


On Thu, May 06, 2004 at 07:45:24PM -0700, Stan Shebs wrote:
> You know, CodeWarrior is not an Apple-only thing; their compiler is
> used by game programmers and for other embedded development. GCC
> has been automatically shut out of a bunch of those areas by not
> having desired features (the inline asm syntax being one of them
> in fact), which is maybe why you haven't heard much about it.
> 
> But, in the absence of anybody expressing any interest at all,
> there's little point in continuing the discussion.

Well, I'll express interest.

First of all, Ian said that this feature would commit GCC to parsing
assembly language for every target.  That doesn't follow.  The proposed
alternative was to confine it to darwin.c, which I don't much like,
because there's a lot of source that would otherwise be easier to port
to powerpc-linux.  I don't see anything terribly gross about having a
"simplified" asm syntax available on the set of targets where
developers are interested enough to implement it.

Several people have concluded from their own experience or from the GCC
bug database that the existing inline asm syntax is not a major source
of bugs.  That's bad logic; as Stan said, the GCC bug database is the
place to look for bugs in GCC involving handling asm statements.  More
interesting are the bug reports that other projects get because of
invalid asm statements; I've seen a huge number of these!  And many of
them, the compiler should have been able to figure out the mistaken
constraints on its own.

And third, I just thing the new syntax is easier to read and simpler to
write.

[By the way, I'm surprised to hear that CodeWarrior will schedule
outside code interleaved with an asm block.  That seems like a really
bad idea!]

-- 
Daniel Jacobowitz


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