[cfe-dev] time of inline assembler evaluation in template specialization

Titus von Boxberg titus at v9g.de
Fri Jun 24 08:45:20 PDT 2011


Am Fr, 24.06.2011, 16:47 schrieb Douglas Gregor:
> On Jun 24, 2011, at 6:09 AM, Titus von Boxberg wrote:
>> Second because there *is* existing code which relies on gcc's (consistent)
>> different levels of inline assembly checking.
>
> This is a (differ) valid argument: that Clang should accept this code to be compatible with GCC.
>
> GCC compatibility is a compelling argument, but we always weigh the pros and cons of a particular GCC
> extension.
>
> How much code will be broken by this?
> 	Apparently very little, since this is the only report we've seen about this problem since we turned on the
> integrated assembler more than a year ago.
>
> Is the code that will be broken reasonable?
> 	This code is (intentionally) ill-formed code that GCC only accepts because it does checking of the clobbers
> at code generation time. This has more of the characteristics of a GCC bug than a language feature.
>
> Is accepting this code detrimental to the language or other users?
> 	Yes, since moving this checking to code generation time makes Clang accept ill-formed programs. For
> example, users in an environment that provide type-checking via Clang (without using code generation) would
> no longer diagnose errors in asm clobbers.
>
> Is there a workaround?
> 	Yes, through the use of the preprocessor.
>
>
> This extension fails basically all of the criteria we use to decide when to implement an extension in Clang.
>
I see and understand all the points (especially the one with the
AST that always should be translateable into code), but I disagree
labelling this as a "GCC bug" being "detrimental to the language"
because it's not (to my knowledge) violating a "language feature"
in the scope of the standard.
I simply like the gcc way better for the reasons I lengthily explained.
But, of course, I see that I myself rely on a nonstandard compiler feature,
and I'll rewrite my code then to use macros.

Thanks a lot for the time to explain!

Regards
Titus





More information about the cfe-dev mailing list