public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/36793]  New: x86-64 does not get __sync_synchronize right
@ 2008-07-10 15:10 jfc at mit dot edu
  2008-11-21 11:18 ` [Bug target/36793] " samuel dot thibault at ens-lyon dot org
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: jfc at mit dot edu @ 2008-07-10 15:10 UTC (permalink / raw)
  To: gcc-bugs

As I understand __sync_synchronize, the intent is to emit a memory barrier
instruction, at least on multiprocessor systems.  Currently on x86
__sync_synchronize inhibits explicit code motion across the builtin function
call but not processor reordering of memory operations across the builtin
function call.

I think mfence is the right instruction on x86-64, and this or a similar
pattern should be added to sync.md:

(define_insn "memory_barrier"
  [(unspec_volatile [(const_int 0)] UNSPEC_MFENCE)]
  "TARGET_SSE2"
  "mfence")


-- 
           Summary: x86-64 does not get __sync_synchronize right
           Product: gcc
           Version: 4.3.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jfc at mit dot edu
 GCC build triplet: x86_64-linux-gnu
  GCC host triplet: x86_64-linux-gnu
GCC target triplet: x86_64-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36793


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

end of thread, other threads:[~2008-11-25  9:16 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-07-10 15:10 [Bug target/36793] New: x86-64 does not get __sync_synchronize right jfc at mit dot edu
2008-11-21 11:18 ` [Bug target/36793] " samuel dot thibault at ens-lyon dot org
2008-11-21 17:24 ` ubizjak at gmail dot com
2008-11-21 17:37 ` hjl dot tools at gmail dot com
2008-11-21 17:38 ` hjl dot tools at gmail dot com
2008-11-21 23:22 ` samuel dot thibault at ens-lyon dot org
2008-11-21 23:40 ` hjl dot tools at gmail dot com
2008-11-22 18:30 ` ubizjak at gmail dot com
2008-11-22 19:42 ` samuel dot thibault at ens-lyon dot org
2008-11-24 16:58 ` uros at gcc dot gnu dot org
2008-11-24 17:00 ` ubizjak at gmail dot com
2008-11-25  9:16 ` ubizjak at gmail dot com

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