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

Reid Kleckner rnk at google.com
Tue Apr 29 13:37:46 PDT 2014


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.

---

With respect to implementation, this should follow the pattern of existing
pragmas, like #pragma data_seg, that simply add implicit attributes to all
captured FunctionDecls.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20140429/0bababee/attachment.html>


More information about the cfe-dev mailing list