[Bug rtl-optimization/111901] Apparently bogus CSE of inline asm with memory clobber

2025-05-31 Thread ubizjak at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111901 Uroš Bizjak changed: What|Removed |Added Status|ASSIGNED|NEW Assignee|ubizjak at gmail d

[Bug rtl-optimization/111901] Apparently bogus CSE of inline asm with memory clobber

2025-05-30 Thread ubizjak at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111901 --- Comment #16 from Uroš Bizjak --- (In reply to Uroš Bizjak from comment #15) > FTR, clobbers are already marked as having side effects: Oops, I got the logic wrong. Please disregard this comment.

[Bug rtl-optimization/111901] Apparently bogus CSE of inline asm with memory clobber

2025-05-30 Thread ubizjak at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111901 --- Comment #15 from Uroš Bizjak --- (In reply to Uroš Bizjak from comment #13) > (In reply to Eric Botcazou from comment #12) > > > So what about just marking inline asms with memory clobber as having side > > effects? > I guess this would wor

[Bug rtl-optimization/111901] Apparently bogus CSE of inline asm with memory clobber

2025-05-30 Thread rsandifo at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111901 --- Comment #14 from Richard Sandiford --- ISTM that the problem is that cselib doesn't consider: (clobber (mem:BLK (scratch))) to be a read from memory (unlike note_uses, which gets this right). cselib instead assumes that the SET_SRC of t

[Bug rtl-optimization/111901] Apparently bogus CSE of inline asm with memory clobber

2025-05-30 Thread ubizjak at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111901 --- Comment #13 from Uroš Bizjak --- (In reply to Eric Botcazou from comment #12) > So what about just marking inline asms with memory clobber as having side > effects? I guess this would work, the compiler must preserve side effects when optim

[Bug rtl-optimization/111901] Apparently bogus CSE of inline asm with memory clobber

2025-05-30 Thread ebotcazou at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111901 --- Comment #12 from Eric Botcazou --- > Later in the compilation pipeline, DCE removes insns 6 and 8 as dead code, > leaving: > > _.c.331r.cmpelim: > >10: {x1:SI=asm_operands;clobber [scratch];} >12: {x3:SI=asm_operands;clobber [scrat

[Bug rtl-optimization/111901] Apparently bogus CSE of inline asm with memory clobber

2025-05-30 Thread ubizjak at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111901 --- Comment #11 from Uroš Bizjak --- (In reply to Eric Botcazou from comment #10) > Is it really invalid to perform CSE on val though? Later in the compilation pipeline, DCE removes insns 6 and 8 as dead code, leaving: _.c.331r.cmpelim: 10

[Bug rtl-optimization/111901] Apparently bogus CSE of inline asm with memory clobber

2025-05-30 Thread ebotcazou at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111901 --- Comment #10 from Eric Botcazou --- Is it really invalid to perform CSE on val though?

[Bug rtl-optimization/111901] Apparently bogus CSE of inline asm with memory clobber

2025-05-29 Thread ubizjak at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111901 Uroš Bizjak changed: What|Removed |Added CC||ebotcazou at gcc dot gnu.org,

[Bug rtl-optimization/111901] Apparently bogus CSE of inline asm with memory clobber

2025-05-29 Thread ubizjak at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111901 --- Comment #8 from Uroš Bizjak --- Compiling the testcase for aarch64-linux-gnu (-O2 -funroll-all-loops) still performs CSE, despite the patch: _.c.325r.reload: 6: {x0:SI=asm_operands;clobber [scratch];} 8: {x2:SI=asm_operands;clobber

[Bug rtl-optimization/111901] Apparently bogus CSE of inline asm with memory clobber

2025-05-29 Thread ubizjak at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111901 Uroš Bizjak changed: What|Removed |Added Keywords||patch --- Comment #7 from Uroš Bizjak --

[Bug rtl-optimization/111901] Apparently bogus CSE of inline asm with memory clobber

2025-05-29 Thread ubizjak at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111901 Uroš Bizjak changed: What|Removed |Added Status|NEW |ASSIGNED Assignee|unassigned at

[Bug rtl-optimization/111901] Apparently bogus CSE of inline asm with memory clobber

2023-10-22 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111901 Andrew Pinski changed: What|Removed |Added Ever confirmed|0 |1 Last reconfirmed|

[Bug rtl-optimization/111901] Apparently bogus CSE of inline asm with memory clobber

2023-10-20 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111901 --- Comment #4 from Andrew Pinski --- Looks like postreload_cse is causing the issue ...

[Bug rtl-optimization/111901] Apparently bogus CSE of inline asm with memory clobber

2023-10-20 Thread torvalds--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111901 --- Comment #3 from Linus Torvalds --- (In reply to Andrew Pinski from comment #1) > I suspect without an input, the cse will happen as there is no other writes > in the loop. Yes, it looks to me like the CSE simply didn't think of the memory c

[Bug rtl-optimization/111901] Apparently bogus CSE of inline asm with memory clobber

2023-10-20 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111901 Andrew Pinski changed: What|Removed |Added Keywords||wrong-code Component|middle-en