[Bug target/103069] cmpxchg isn't optimized

2025-07-11 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103069 Richard Biener changed: What|Removed |Added Target Milestone|12.5|---

[Bug target/103069] cmpxchg isn't optimized

2024-06-20 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103069 Richard Biener changed: What|Removed |Added Target Milestone|12.4|12.5 --- Comment #25 from Richard Bien

[Bug target/103069] cmpxchg isn't optimized

2023-05-08 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103069 Richard Biener changed: What|Removed |Added Target Milestone|12.3|12.4 --- Comment #24 from Richard Bien

[Bug target/103069] cmpxchg isn't optimized

2022-08-19 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103069 Richard Biener changed: What|Removed |Added Target Milestone|12.2|12.3 --- Comment #23 from Richard Bien

[Bug target/103069] cmpxchg isn't optimized

2022-05-06 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103069 Jakub Jelinek changed: What|Removed |Added Target Milestone|12.0|12.2 --- Comment #22 from Jakub Jelinek

[Bug target/103069] cmpxchg isn't optimized

2022-04-13 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103069 --- Comment #21 from CVS Commits --- The master branch has been updated by Hongyu Wang : https://gcc.gnu.org/g:522f25e90c781d284f8347a04940db8b41c42fd5 commit r12-8136-g522f25e90c781d284f8347a04940db8b41c42fd5 Author: Hongyu Wang Date: Wed

[Bug target/103069] cmpxchg isn't optimized

2022-02-22 Thread thiago at kde dot org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103069 --- Comment #20 from Thiago Macieira --- I think there will be cases where the relaxation makes sense and others where it doesn't because the surrounding code already does it. So I'd like to control per emission. If I can't do it per code block

[Bug target/103069] cmpxchg isn't optimized

2022-02-22 Thread wwwhhhyyy333 at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103069 --- Comment #19 from Hongyu Wang --- (In reply to Thiago Macieira from comment #18) > (In reply to Jakub Jelinek from comment #17) > > _Pragma("GCC target \"relax-cmpxchg-loop\"") > > should do that (ditto target("relax-cmpxchg-loop") attribute)

[Bug target/103069] cmpxchg isn't optimized

2022-02-22 Thread thiago at kde dot org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103069 --- Comment #18 from Thiago Macieira --- (In reply to Jakub Jelinek from comment #17) > _Pragma("GCC target \"relax-cmpxchg-loop\"") > should do that (ditto target("relax-cmpxchg-loop") attribute). The attribute is applied to a function. I'm ho

[Bug target/103069] cmpxchg isn't optimized

2022-02-22 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103069 Jakub Jelinek changed: What|Removed |Added CC||jakub at gcc dot gnu.org --- Comment #1

[Bug target/103069] cmpxchg isn't optimized

2022-02-22 Thread thiago at kde dot org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103069 --- Comment #16 from Thiago Macieira --- Can this option be enabled and disabled with a _Pragma?

[Bug target/103069] cmpxchg isn't optimized

2022-02-22 Thread wwwhhhyyy333 at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103069 --- Comment #15 from Hongyu Wang --- (In reply to Thiago Macieira from comment #14) > I'd restrict relaxations to loops emitted by the compiler. All other atomic > operations shouldn't be modified at all, unless the user asks for it. That > incl

[Bug target/103069] cmpxchg isn't optimized

2022-02-21 Thread thiago at kde dot org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103069 --- Comment #14 from Thiago Macieira --- I'd restrict relaxations to loops emitted by the compiler. All other atomic operations shouldn't be modified at all, unless the user asks for it. That includes non-looping atomic operations (like LOCK BTC

[Bug target/103069] cmpxchg isn't optimized

2022-02-21 Thread wwwhhhyyy333 at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103069 --- Comment #13 from Hongyu Wang --- All above glibc cases are now both relaxed by an load/cmp to skip cmpxchg under -mrelax-cmpxchg-loop, but for > do > { > flags = THREAD_GETMEM (self, cancelhandling); > newval = THREA

[Bug target/103069] cmpxchg isn't optimized

2022-02-21 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103069 --- Comment #12 from CVS Commits --- The master branch has been updated by Hongyu Wang : https://gcc.gnu.org/g:0435b978f95971e139882549f5a1765c50682216 commit r12-7316-g0435b978f95971e139882549f5a1765c50682216 Author: Hongyu Wang Date: Fri

[Bug target/103069] cmpxchg isn't optimized

2022-02-15 Thread wwwhhhyyy333 at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103069 --- Comment #11 from Hongyu Wang --- For the case with atomic_compare_exchange_weak_release, it can be expanded as loop: mov%eax,%r8d and$0xfff8,%r8d mov(%r8),%rsi <--- load lock first cmp%rsi,%rax <--- c

[Bug target/103069] cmpxchg isn't optimized

2022-01-24 Thread thiago at kde dot org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103069 --- Comment #10 from Thiago Macieira --- (In reply to H.J. Lu from comment #9) > nptl/nptl_setxid.c in glibc has > > do > { > flags = THREAD_GETMEM (self, cancelhandling); > newval = THREAD_ATOMIC_CMPXCHG_VAL (self, cance

[Bug target/103069] cmpxchg isn't optimized

2022-01-24 Thread hjl.tools at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103069 H.J. Lu changed: What|Removed |Added Status|REOPENED|NEW --- Comment #9 from H.J. Lu --- nptl/npt

[Bug target/103069] cmpxchg isn't optimized

2022-01-24 Thread hjl.tools at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103069 --- Comment #8 from H.J. Lu --- nptl/pthread_create.c has do pd->nextevent = __nptl_last_event; while (atomic_compare_and_exchange_bool_acq (&__nptl_last_event,

[Bug target/103069] cmpxchg isn't optimized

2022-01-24 Thread hjl.tools at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103069 --- Comment #7 from H.J. Lu --- nptl/pthread_mutex_unlock.c in glibc has: do { newval = oldval & PTHREAD_MUTEX_PRIO_CEILING_MASK; } while (!atomic_compare_exchange_weak_release (&mutex->__data.__lock,

[Bug target/103069] cmpxchg isn't optimized

2022-01-24 Thread hjl.tools at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103069 H.J. Lu changed: What|Removed |Added Status|RESOLVED|REOPENED Ever confirmed|0

[Bug target/103069] cmpxchg isn't optimized

2021-11-18 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103069 --- Comment #5 from CVS Commits --- The master branch has been updated by Hongyu Wang : https://gcc.gnu.org/g:15f5e70cbb33b40c97325ef9d7747a148d39 commit r12-5363-g15f5e70cbb33b40c97325ef9d7747a148d39 Author: Hongyu Wang Date: Thu N

[Bug target/103069] cmpxchg isn't optimized

2021-11-15 Thread hjl.tools at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103069 H.J. Lu changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Target Milestone|---

[Bug target/103069] cmpxchg isn't optimized

2021-11-15 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103069 --- Comment #3 from CVS Commits --- The master branch has been updated by Hongyu Wang : https://gcc.gnu.org/g:4d281ff7ddd8f6365943c0a622107f92315bb8a6 commit r12-5265-g4d281ff7ddd8f6365943c0a622107f92315bb8a6 Author: Hongyu Wang Date: Fri N

[Bug target/103069] cmpxchg isn't optimized

2021-11-04 Thread thiago at kde dot org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103069 --- Comment #2 from Thiago Macieira --- See also bug 103090 for a few more (restricted) possibilities to replace a cmpxchg loop with a LOCK RMW operation.

[Bug target/103069] cmpxchg isn't optimized

2021-11-03 Thread thiago at kde dot org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103069 --- Comment #1 from Thiago Macieira --- (the assembly doesn't match the source code, but we got your point) Another possible improvement for the __atomic_fetch_{and,nand,or} functions is that it can check whether the fetched value is already co