[PATCH] clang: forward -no-integrated-as from the driver

David Woodhouse dwmw2 at infradead.org
Fri Feb 21 06:48:36 PST 2014


On Fri, 2014-02-21 at 09:28 -0500, Rafael EspĂ­ndola wrote:
> > That doesn't make sense, because '-S' means "no assembler".
> > So -no-integrated-as should be *implicit* in that.
> 
> I disagree. Clang can parse assembly and we should make more use of it
> than we do now. Right now the only thing we do is diagnose errors
> earlier, but we should really be doing things like checking provided
> constraints against the instructions.

I'm very wary of that approach. Surely the use case for inline assembly,
almost by *definition*, is that we're doing something that the compiler
doesn't understand and/or doesn't get right.

We don't want it looking inside and thinking it knows best, even in the
case where it *is* going to see instructions that it actually knows
about. Perhaps *especially* in that case.

But I suppose the specific case you mention, of checking constraints,
could have some merit. Even if the compiler takes a strictly "hands-off"
approach and doesn't screw with the output in any way, it could still
*see* that it's using instructions which clobber certain registers, and
then give a warning if those clobbers are missing.

But unless it's actually *using* the integrated assembler, if it can't
parse what's in the inline asm, the failure mode should be that it just
does nothing and doesn't manage to emit any such warnings.

It certainly shouldn't bail out with an error, which is the subject of
bug 18891.

-- 
dwmw2

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 5745 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140221/55e24aad/attachment.bin>


More information about the cfe-commits mailing list