[Bug target/98737] Atomic operation on x86 no optimized to use flags

2022-01-14 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98737 --- Comment #12 from CVS Commits --- The master branch has been updated by Jakub Jelinek : https://gcc.gnu.org/g:9896e96d4cae00d0f4d2b694284cb30bbd9c80fc commit r12-6577-g9896e96d4cae00d0f4d2b694284cb30bbd9c80fc Author: Jakub Jelinek Date: F

[Bug target/98737] Atomic operation on x86 no optimized to use flags

2022-01-12 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98737 --- Comment #11 from Jakub Jelinek --- Created attachment 52170 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=52170&action=edit gcc12-pr98737-canon.patch Untested patch to fix up if users misuse the fetch_op or op_fetch atomic when they s

[Bug target/98737] Atomic operation on x86 no optimized to use flags

2022-01-03 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98737 --- Comment #10 from CVS Commits --- The master branch has been updated by Jakub Jelinek : https://gcc.gnu.org/g:6362627b27f395b054f359244fcfcb15ac0ac2ab commit r12-6190-g6362627b27f395b054f359244fcfcb15ac0ac2ab Author: Jakub Jelinek Date: M

[Bug target/98737] Atomic operation on x86 no optimized to use flags

2021-12-14 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98737 Jakub Jelinek changed: What|Removed |Added Attachment #50058|0 |1 is obsolete|

[Bug target/98737] Atomic operation on x86 no optimized to use flags

2021-01-26 Thread drepper.fsp+rhbz at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98737 --- Comment #8 from Ulrich Drepper --- (In reply to Jakub Jelinek from comment #7) > The sub fix won't be the same as would add, perhaps xor/or/and can be > handled by the same peephole2, but even for that I'm not sure. Just a proposal, but I ca

[Bug target/98737] Atomic operation on x86 no optimized to use flags

2021-01-26 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98737 --- Comment #7 from Jakub Jelinek --- The sub fix won't be the same as would add, perhaps xor/or/and can be handled by the same peephole2, but even for that I'm not sure. Though e.g. trying __atomic_or_fetch (&a, b, ...) == 0 doesn't seem to be

[Bug target/98737] Atomic operation on x86 no optimized to use flags

2021-01-26 Thread drepper.fsp+rhbz at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98737 --- Comment #6 from Ulrich Drepper --- (In reply to Jakub Jelinek from comment #5) > Created attachment 50058 [details] > gcc11-pr98737.patch > > Untested fix. This only handles sub? The same applies to add, or, and, xor. Maybe nand? Can thi

[Bug target/98737] Atomic operation on x86 no optimized to use flags

2021-01-26 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98737 Jakub Jelinek changed: What|Removed |Added Assignee|unassigned at gcc dot gnu.org |jakub at gcc dot gnu.org

[Bug target/98737] Atomic operation on x86 no optimized to use flags

2021-01-19 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98737 Jakub Jelinek changed: What|Removed |Added CC||jakub at gcc dot gnu.org --- Comment #4

[Bug target/98737] Atomic operation on x86 no optimized to use flags

2021-01-19 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98737 --- Comment #3 from Jonathan Wakely --- (In reply to Uroš Bizjak from comment #2) > This can be optimized with peephole2, we already have similar case in > sync.md: > > ;; This peephole2 and following insn optimize > ;; __sync_fetch_and_add (x,

[Bug target/98737] Atomic operation on x86 no optimized to use flags

2021-01-19 Thread ubizjak at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98737 --- Comment #2 from Uroš Bizjak --- This can be optimized with peephole2, we already have similar case in sync.md: ;; This peephole2 and following insn optimize ;; __sync_fetch_and_add (x, -N) == N into just lock {add,sub,inc,dec} ;; followed by

[Bug target/98737] Atomic operation on x86 no optimized to use flags

2021-01-18 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98737 Richard Biener changed: What|Removed |Added Status|UNCONFIRMED |NEW Last reconfirmed|