Re: [lttng-dev] [PATCH 02/11] urcu/uatomic: Use atomic builtins if configured
"Paul E. McKenney via lttng-dev" <[email protected]>
| Newsgroups | org.lttng.lists.lttng-dev |
|---|---|
| Message-ID | <8152f4fb-7a3b-458e-a63c-414bc99ac0d4@paulmck-laptop> |
On Thu, Jun 22, 2023 at 03:53:33PM -0400, Olivier Dion wrote: > On Thu, 22 Jun 2023, "Paul E. McKenney" <[email protected]> wrote: > > > I suggest C11 volatile atomic load/store. Load/store fusing is permitted > > for non-volatile atomic loads and stores, and such fusing can ruin your > > code's entire day. ;-) > > Good catch. Seems like not a problem on GCC (yet), but Clang is extremely > aggressive and seems to do store fusing on some corner cases [0]. > > However, I do not find any simple reproducer of load/store fusing. Do > you have example of such fusing, or is this a precaution? In the > meantime, back to reading the standard to be certain :-) > > [0] https://godbolt.org/z/odKG9a75a I certainly have heard a number of compiler writers thinking in terms of doing load/store fusing, some of whom were trying to get rid of the volatile variants in order to remove an impediment to their mission of optimizing all programs out of existence. ;-) I therefore suggest taking this possibility quite seriously. Thanx, Paul _______________________________________________ lttng-dev mailing list [email protected] https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev