[cfe-dev] [RFC] A proposal for #pragma optnone

Chandler Carruth chandlerc at google.com
Tue Apr 29 13:43:39 PDT 2014


On Tue, Apr 29, 2014 at 1:37 PM, Reid Kleckner <rnk at google.com> wrote:

> On Tue, Apr 29, 2014 at 1:06 PM, Chandler Carruth <chandlerc at google.com>wrote:
>>
>> I think reducing the proliferation of pragmas is a good thing, so let's
>>> implement the GCC syntax.  We can add support for the MSVC syntax later.
>>>  We probably want to defer that because the primary use case for it is
>>> working around MSVC miscompiles.
>>>
>>
>> Why doesn't this logic apply to both? I don't *really* care how it is
>> spelled (I agree with Renato that we can discourage it regardless) I'm just
>> not sure that the concern of existing usage primarily working around
>> compiler-specific miscompiles is MSVC specific.
>>
>
> Usually these workarounds have a version check around them that we miss,
> like _MSC_VER < 1700.  I wonder if the same is true for __GNUC__ usage.
>
> It also occurs to me that if we add this pragma, users might use it to
> work around "miscompiles" of invalid user code.  On the other hand, it's
> not like Clang is bug-free either.
>

Yea, I'm just curious why we don't want a clang-specific spelling so that
we don't pick up any of these. :: shrug :: Note that we emulate a GCC
version that is not useful for reasoning about live miscompile bugs.

I would still try to spell it the same as GCCs if convenient: "#pragma
clang optimize 0" or whatever.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20140429/c9aa4a7d/attachment.html>


More information about the cfe-dev mailing list