C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Fwd: Use of volatile as function argument should not be deprecated.

From: Arthur O'Dwyer <arthur.j.odwyer_at_[hidden]>
Date: Sat, 11 Jun 2022 13:08:23 -0400
On Sat, Jun 11, 2022 at 2:40 AM Bo Persson via Std-Proposals <
std-proposals_at_[hidden]> wrote:

> On 2022-06-10 at 23:09, Arthur O'Dwyer via Std-Proposals wrote:
> >
> > I think I need to re-post this paragraph.
> >
> > Here's another way to look at it: *"Optimization barrier" is not a
> > first-class principle.* Instead, the fundamental organizing principle is
> > *"The tool can't optimize what it can't see."* So, if you really really
> > want something not to be optimized, then you simply mentally reduce the
> > problem to "How can I make my optimizing tool /not see/ this function?"
>
> So perhaps what we need is a [[dont_look]] directive?
>

If the optimizing tool you're trying to hide from is specifically a tool
that consumes .cpp files (and recognizes that directive), then yeah, sure.
If it's a tool like Green Hills' elxr that consumes .o files containing
binary code, then of course putting a *source-level* directive won't work.
If it's a Perl script that doesn't understand `[[` syntax, then of course
that won't work.
You always need to think about "What am I actually trying to *accomplish*
here? What is my *goal*? *What optimizing tool* am I trying to interact
with?"

–Arthur

Received on 2022-06-11 17:08:35