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

Hal Finkel hfinkel at anl.gov
Tue Apr 29 13:49:37 PDT 2014


----- Original Message -----
> From: "Chandler Carruth" <chandlerc at google.com>
> To: "Reid Kleckner" <rnk at google.com>
> Cc: "clang-dev Developers" <cfe-dev at cs.uiuc.edu>
> Sent: Tuesday, April 29, 2014 3:43:39 PM
> Subject: Re: [cfe-dev] [RFC] A proposal for #pragma optnone
> 
> 
> 
> 
> 
> 
> 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.

+1 -- We specifically don't want to pick up any of these from other compilers.

 -Hal

> 
> 
> I would still try to spell it the same as GCCs if convenient:
> "#pragma clang optimize 0" or whatever.
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
> 

-- 
Hal Finkel
Assistant Computational Scientist
Leadership Computing Facility
Argonne National Laboratory



More information about the cfe-dev mailing list