[PATCH 1/2 v2] c++: Implement P1494 and P3641 Partial program correctness [PR119060].
Michael Matz
matz@suse.de
Mon Sep 8 13:21:21 GMT 2025
Hello,
On Mon, 8 Sep 2025, Ville Voutilainen wrote:
> But I can (more slowly) dig up what the other developer tried to use for
> the prints. It isn't printf, printf doesn't trigger the problem because
> optimizers know what printf is. The print function was some
> android-specific logging function that clang didn't recognize as an i/o
> function that should've just effected<sic> the barrier automatically.
>
> So, at the end of the day, even if it was some clang bug where it
> over-eagerly nuked a whole CFG path even with an opaque or a
> side-effectful call on it, such things happen in practice, and *maybe*
> they happen less likely if compilers recognize an
> observable_checkpoint(). Maybe.
If a compiler has a bug resulting in removing observable side-effects
there is no rational reason to believe that adding a mean to add more
observable side-effects into the language (that in the end can be 'hidden'
in called external functions) would magically fix such bugs. Instead the
bug needs to be fixed. I think that magic thinking is what Richi refers
to as FUD.
Ciao,
Michael.
More information about the Libstdc++
mailing list