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

Robinson, Paul Paul_Robinson at playstation.sony.com
Tue Apr 29 16:26:25 PDT 2014


> -----Original Message-----
> From: Renato Golin [mailto:renato.golin at linaro.org]
> Sent: Tuesday, April 29, 2014 4:01 PM
> To: Hal Finkel
> Cc: Robinson, Paul; clang-dev Developers
> Subject: Re: [cfe-dev] [RFC] A proposal for #pragma optnone
> 
> On 29 April 2014 22:58, Hal Finkel <hfinkel at anl.gov> wrote:
> > Personally, I don't care that it is spelled like gcc's pragma. But I
> suppose having it (however it is spelled), and I think that it should
> not be spelled exactly like gcc's pragma. There seemed to be some
> opinions (by other people) that we don't want to invent new pragmas,
> thus the rationale for emulating gcc, but in this particular case, we
> *want* incompatibility, and so I don't find their arguments compelling.
> 
> This is only a valid argument on the "clang miscompiles" use case, not
> in the "debug specific function" use case. IMO, the second case is a
> lot more important and long lasting than the first.

I disagree, I think it's the other way around.

Workarounds for mis-compiles will be checked into a VCS and be 
preserved until at least the next compiler upgrade (maybe longer) 
and until somebody notices the workaround is still there and takes
the time to verify that the corresponding new compiler is fixed.
A directive to address a mis-compile on one platform really doesn't
want to be applied across all platforms, unnecessarily, so having
platform-specific syntax is good.

Debugging situations are more ephemeral and unlikely to be committed 
long-term; at least in my own work, it's *really* unusual to try to
debug the same problem on multiple platforms simultaneously, so a
cross-platform-compatible debug directive isn't important.
(Verifying the fix is a different story of course; but for actually
tracking it down, I'm only going to iterate on one platform.)
--paulr

> 
> cheers,
> --renato





More information about the cfe-dev mailing list