public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/86072] Poor codegen with atomics
[not found] <bug-86072-4@http.gcc.gnu.org/bugzilla/>
@ 2023-12-22 20:30 ` phosit at autistici dot org
0 siblings, 0 replies; only message in thread
From: phosit at autistici dot org @ 2023-12-22 20:30 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86072
Phosit <phosit at autistici dot org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |phosit at autistici dot org
--- Comment #4 from Phosit <phosit at autistici dot org> ---
(In reply to Richard Biener from comment #2)
> Somebody has to decide if it's worth optimizing them and has to sit down and
> exactly specify what kind of optimizations are valid.
There is a paper about the optimization of atomics. It might not be detailed
enough.
https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4455.html
Note that the memory-model changed a bit since the release of that paper.
> I guess it's worth optimizing them if these cases appear in real-world code
> (and then we'd like to see examples).
std::shared_ptr use fetch_add and fetch_sub. When a std::shared_ptr is not used
for syncronization this optimization could take effect.
PR 48987 is specifically about combining multiple fetch_add and fetch_sub.
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-12-22 20:30 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <bug-86072-4@http.gcc.gnu.org/bugzilla/>
2023-12-22 20:30 ` [Bug tree-optimization/86072] Poor codegen with atomics phosit at autistici dot org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).