C++ Logo

liaison

Advanced search

Re: [wg14/wg21 liaison] Rebasing C++ to C23

From: Martin Uecker <ma.uecker_at_[hidden]>
Date: Thu, 02 May 2024 20:44:07 +0200
Am Donnerstag, dem 02.05.2024 um 21:21 +0300 schrieb Ville Voutilainen:
> On Thu, 2 May 2024 at 21:19, Ville Voutilainen
> <ville.voutilainen_at_[hidden]> wrote:
> >
> > On Thu, 2 May 2024 at 21:16, Martin Uecker <ma.uecker_at_[hidden]> wrote:
> >
> > > > That's a separable problem (because we have a separate proposal for an
> > > > optimization barrier),
> > > > but if it's a volatile write, it's an optimization barrier because the
> > > > volatile write is an observable effect.
> > > > So I don't think this is a problem.
> > >
> > > If UB makes a program have no semantics at all, it is impossible
> > > to define a barrier.
> > >
> > > If one accepts that UB can not affect previous observable behavior,
> > > then all is well, but the C++ standard states the opposite last
> > > time I checked.
> >
> > That's why https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p1494r2.html
> > changes those statements.
>
> ..but yes, you are correct in the sense that we would additionally
> need to make volatile writes
> be such observable checkpoints, which is an approach that I think
> Davis is considering for
> a revision of that proposal.

Yes, if this is voted in, then WG21 has essentially abandoned the extreme
view of UB, which would be great step forward. I still do not see why
one needs to have a special notion of observable checkpoints. In my
opinion the whole concept of "observable" already implies such a barrier
and it is sufficient to fix the concept of UB to not break this.

Martin

Received on 2024-05-02 18:44:11