public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug inline-asm/100953] New: Add memory clobbers just for reads or just for writes
@ 2021-06-07 22:52 segher at gcc dot gnu.org
  2021-06-08  8:00 ` [Bug inline-asm/100953] " rguenth at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: segher at gcc dot gnu.org @ 2021-06-07 22:52 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100953

            Bug ID: 100953
           Summary: Add memory clobbers just for reads or just for writes
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: inline-asm
          Assignee: unassigned at gcc dot gnu.org
          Reporter: segher at gcc dot gnu.org
  Target Milestone: ---

See
<https://lore.kernel.org/linux-toolchains/20210604182357.GA1688170@rowland.harvard.edu/T/#mb0e293105ae45974af7ed435847e2a6f72158a0a>
.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug inline-asm/100953] Add memory clobbers just for reads or just for writes
  2021-06-07 22:52 [Bug inline-asm/100953] New: Add memory clobbers just for reads or just for writes segher at gcc dot gnu.org
@ 2021-06-08  8:00 ` rguenth at gcc dot gnu.org
  2021-06-08 13:54 ` segher at gcc dot gnu.org
  2021-06-22 20:38 ` foom at fuhm dot net
  2 siblings, 0 replies; 4+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-06-08  8:00 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100953

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
                 CC|                            |rguenth at gcc dot gnu.org
   Last reconfirmed|                            |2021-06-08
     Ever confirmed|0                           |1

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
Obviously "just for writes" is nonsense, but what's missing is the ability
to add a (use "memory"), which maybe just means allowing to specify
"memory" as use?  That would prevent moving stores across such asm() but
it would not cause "pointless reloading of globals".

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug inline-asm/100953] Add memory clobbers just for reads or just for writes
  2021-06-07 22:52 [Bug inline-asm/100953] New: Add memory clobbers just for reads or just for writes segher at gcc dot gnu.org
  2021-06-08  8:00 ` [Bug inline-asm/100953] " rguenth at gcc dot gnu.org
@ 2021-06-08 13:54 ` segher at gcc dot gnu.org
  2021-06-22 20:38 ` foom at fuhm dot net
  2 siblings, 0 replies; 4+ messages in thread
From: segher at gcc dot gnu.org @ 2021-06-08 13:54 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100953

--- Comment #2 from Segher Boessenkool <segher at gcc dot gnu.org> ---
Sure :-)  But syntactically it probably is best put amongst the clobbers,
all code parsing that already knows about handling various special cases
of syntax (well, just "memory" and "cc", and the various ways of naming
registers).

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug inline-asm/100953] Add memory clobbers just for reads or just for writes
  2021-06-07 22:52 [Bug inline-asm/100953] New: Add memory clobbers just for reads or just for writes segher at gcc dot gnu.org
  2021-06-08  8:00 ` [Bug inline-asm/100953] " rguenth at gcc dot gnu.org
  2021-06-08 13:54 ` segher at gcc dot gnu.org
@ 2021-06-22 20:38 ` foom at fuhm dot net
  2 siblings, 0 replies; 4+ messages in thread
From: foom at fuhm dot net @ 2021-06-22 20:38 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100953

James Y Knight <foom at fuhm dot net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |foom at fuhm dot net

--- Comment #3 from James Y Knight <foom at fuhm dot net> ---
For the compiler-barrier use-cases, you can use the __atomic_signal_fence
builtin instead of an empty inline-asm statement.

E.g. if you want to make sure that all writes apperaing after a barrier are
actually emitted after all reads/writes appearing before the barrier, use
__atomic_signal_fence(__ATOMIC_RELEASE).

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-06-22 20:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-07 22:52 [Bug inline-asm/100953] New: Add memory clobbers just for reads or just for writes segher at gcc dot gnu.org
2021-06-08  8:00 ` [Bug inline-asm/100953] " rguenth at gcc dot gnu.org
2021-06-08 13:54 ` segher at gcc dot gnu.org
2021-06-22 20:38 ` foom at fuhm dot net

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).