public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "mwahab at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug target/65697] __atomic memory barriers not strong enough for __sync builtins Date: Wed, 05 Aug 2015 11:21:00 -0000 [thread overview] Message-ID: <bug-65697-4-Rje62GECF6@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-65697-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65697 --- Comment #66 from mwahab at gcc dot gnu.org --- Author: mwahab Date: Wed Aug 5 11:20:59 2015 New Revision: 226618 URL: https://gcc.gnu.org/viewcvs?rev=226618&root=gcc&view=rev Log: Backport from trunk 2015-05-12 Andrew MacLeod <amacleod@redhat.com> PR target/65697 * coretypes.h (MEMMODEL_SYNC, MEMMODEL_BASE_MASK): New macros. (enum memmodel): Add SYNC_{ACQUIRE,RELEASE,SEQ_CST}. * tree.h (memmodel_from_int, memmodel_base, is_mm_relaxed) (is_mm_consume,is_mm_acquire, is_mm_release, is_mm_acq_rel) (is_mm_seq_cst, is_mm_sync): New accessor functions. * builtins.c (expand_builtin_sync_operation) (expand_builtin_compare_and_swap): Use MEMMODEL_SYNC_SEQ_CST. (expand_builtin_sync_lock_release): Use MEMMODEL_SYNC_RELEASE. (get_memmodel, expand_builtin_atomic_compare_exchange) (expand_builtin_atomic_load, expand_builtin_atomic_store) (expand_builtin_atomic_clear): Use new accessor routines. (expand_builtin_sync_synchronize): Use MEMMODEL_SYNC_SEQ_CST. * optabs.c (expand_compare_and_swap_loop): Use MEMMODEL_SYNC_SEQ_CST. (maybe_emit_sync_lock_test_and_set): Use new accessors and MEMMODEL_SYNC_ACQUIRE. (expand_sync_lock_test_and_set): Use MEMMODEL_SYNC_ACQUIRE. (expand_mem_thread_fence, expand_mem_signal_fence, expand_atomic_load) (expand_atomic_store): Use new accessors. * emit-rtl.c (need_atomic_barrier_p): Add additional enum cases. * tsan.c (instrument_builtin_call): Update check for memory model beyond final enum to use MEMMODEL_LAST. * c-family/c-common.c: Use new accessor for memmodel_base. * config/aarch64/aarch64.c (aarch64_expand_compare_and_swap): Use new accessors. * config/aarch64/atomics.md (atomic_load<mode>,atomic_store<mode>) (arch64_load_exclusive<mode>, aarch64_store_exclusive<mode>) (mem_thread_fence, *dmb): Likewise. * config/alpha/alpha.c (alpha_split_compare_and_swap) (alpha_split_compare_and_swap_12): Likewise. * config/arm/arm.c (arm_expand_compare_and_swap) (arm_split_compare_and_swap, arm_split_atomic_op): Likewise. * config/arm/sync.md (atomic_load<mode>, atomic_store<mode>) (atomic_loaddi): Likewise. * config/i386/i386.c (ix86_destroy_cost_data, ix86_memmodel_check): Likewise. * config/i386/sync.md (mem_thread_fence, atomic_store<mode>): Likewise. * config/ia64/ia64.c (ia64_expand_atomic_op): Add new memmodel cases and use new accessors. * config/ia64/sync.md (mem_thread_fence, atomic_load<mode>) (atomic_store<mode>, atomic_compare_and_swap<mode>) (atomic_exchange<mode>): Use new accessors. * config/mips/mips.c (mips_process_sync_loop): Likewise. * config/pa/pa.md (atomic_loaddi, atomic_storedi): Likewise. * config/rs6000/rs6000.c (rs6000_pre_atomic_barrier) (rs6000_post_atomic_barrier): Add new cases. (rs6000_expand_atomic_compare_and_swap): Use new accessors. * config/rs6000/sync.md (mem_thread_fence): Add new cases. (atomic_load<mode>): Add new cases and use new accessors. (store_quadpti): Add new cases. * config/s390/s390.md (mem_thread_fence, atomic_store<mode>): Use new accessors. * config/sparc/sparc.c (sparc_emit_membar_for_model): Use new accessors. * doc/extend.texi: Update docs to indicate 16 bits are used for memory model, not 8. Modified: branches/gcc-5-branch/gcc/ChangeLog branches/gcc-5-branch/gcc/builtins.c branches/gcc-5-branch/gcc/c-family/c-common.c branches/gcc-5-branch/gcc/config/aarch64/aarch64.c branches/gcc-5-branch/gcc/config/aarch64/atomics.md branches/gcc-5-branch/gcc/config/alpha/alpha.c branches/gcc-5-branch/gcc/config/arm/arm.c branches/gcc-5-branch/gcc/config/arm/sync.md branches/gcc-5-branch/gcc/config/i386/i386.c branches/gcc-5-branch/gcc/config/i386/sync.md branches/gcc-5-branch/gcc/config/ia64/ia64.c branches/gcc-5-branch/gcc/config/ia64/sync.md branches/gcc-5-branch/gcc/config/mips/mips.c branches/gcc-5-branch/gcc/config/pa/pa.md branches/gcc-5-branch/gcc/config/rs6000/rs6000.c branches/gcc-5-branch/gcc/config/rs6000/sync.md branches/gcc-5-branch/gcc/config/s390/s390.md branches/gcc-5-branch/gcc/config/sparc/sparc.c branches/gcc-5-branch/gcc/coretypes.h branches/gcc-5-branch/gcc/doc/extend.texi branches/gcc-5-branch/gcc/emit-rtl.c branches/gcc-5-branch/gcc/optabs.c branches/gcc-5-branch/gcc/tree.h branches/gcc-5-branch/gcc/tsan.c
next prev parent reply other threads:[~2015-08-05 11:21 UTC|newest] Thread overview: 70+ messages / expand[flat|nested] mbox.gz Atom feed top 2015-04-08 11:25 [Bug target/65697] New: " matthew.wahab at arm dot com 2015-04-08 11:33 ` [Bug target/65697] " matthew.wahab at arm dot com 2015-04-08 16:16 ` jakub at gcc dot gnu.org 2015-04-09 9:53 ` matthew.wahab at arm dot com 2015-04-09 10:08 ` torvald at gcc dot gnu.org 2015-04-09 10:11 ` torvald at gcc dot gnu.org 2015-04-09 10:47 ` matthew.wahab at arm dot com 2015-04-09 11:10 ` redi at gcc dot gnu.org 2015-04-09 11:25 ` matthew.wahab at arm dot com 2015-04-09 11:51 ` amacleod at redhat dot com 2015-04-09 14:03 ` matthew.wahab at arm dot com 2015-04-10 15:09 ` jgreenhalgh at gcc dot gnu.org 2015-04-15 10:16 ` aph at gcc dot gnu.org 2015-04-15 11:11 ` mwahab at gcc dot gnu.org 2015-04-15 11:54 ` jakub at gcc dot gnu.org 2015-04-15 12:43 ` aph at gcc dot gnu.org 2015-04-15 13:01 ` mwahab at gcc dot gnu.org 2015-04-15 14:10 ` aph at gcc dot gnu.org 2015-04-15 14:33 ` mwahab at gcc dot gnu.org 2015-04-15 14:49 ` aph at gcc dot gnu.org 2015-04-15 15:49 ` torvald at gcc dot gnu.org 2015-04-15 20:05 ` torvald at gcc dot gnu.org 2015-04-15 20:49 ` jgreenhalgh at gcc dot gnu.org 2015-04-15 22:13 ` torvald at gcc dot gnu.org 2015-04-16 3:45 ` amacleod at redhat dot com 2015-04-16 8:11 ` mwahab at gcc dot gnu.org 2015-04-16 8:50 ` mwahab at gcc dot gnu.org 2015-04-16 9:01 ` jgreenhalgh at gcc dot gnu.org 2015-04-16 9:18 ` mwahab at gcc dot gnu.org 2015-04-16 11:37 ` amacleod at redhat dot com 2015-04-16 11:54 ` torvald at gcc dot gnu.org 2015-04-16 12:13 ` mwahab at gcc dot gnu.org 2015-04-16 13:27 ` jgreenhalgh at gcc dot gnu.org 2015-04-17 15:38 ` torvald at gcc dot gnu.org 2015-04-17 15:48 ` torvald at gcc dot gnu.org 2015-04-17 18:00 ` amacleod at redhat dot com 2015-04-20 13:42 ` mwahab at gcc dot gnu.org 2015-04-20 15:17 ` mwahab at gcc dot gnu.org 2015-04-21 18:51 ` rth at gcc dot gnu.org 2015-04-28 15:32 ` jgreenhalgh at gcc dot gnu.org 2015-04-29 8:47 ` mwahab at gcc dot gnu.org 2015-04-29 12:20 ` jgreenhalgh at gcc dot gnu.org 2015-04-29 13:26 ` mwahab at gcc dot gnu.org 2015-04-29 16:04 ` amacleod at redhat dot com 2015-04-30 8:20 ` mwahab at gcc dot gnu.org 2015-05-01 12:53 ` torvald at gcc dot gnu.org 2015-05-06 14:25 ` amacleod at redhat dot com 2015-05-06 15:58 ` mwahab at gcc dot gnu.org 2015-05-07 13:25 ` mwahab at gcc dot gnu.org 2015-05-08 8:01 ` mwahab at gcc dot gnu.org 2015-05-11 13:44 ` jgreenhalgh at gcc dot gnu.org 2015-05-11 15:58 ` mwahab at gcc dot gnu.org 2015-05-12 20:02 ` amacleod at redhat dot com 2015-06-01 15:19 ` mwahab at gcc dot gnu.org 2015-06-01 15:21 ` mwahab at gcc dot gnu.org 2015-06-01 15:25 ` mwahab at gcc dot gnu.org 2015-06-11 7:35 ` ramana at gcc dot gnu.org 2015-06-29 16:04 ` mwahab at gcc dot gnu.org 2015-06-29 16:09 ` mwahab at gcc dot gnu.org 2015-06-29 16:12 ` mwahab at gcc dot gnu.org 2015-08-05 11:21 ` mwahab at gcc dot gnu.org [this message] 2015-08-05 11:30 ` mwahab at gcc dot gnu.org 2015-08-05 11:41 ` mwahab at gcc dot gnu.org 2015-08-05 11:49 ` mwahab at gcc dot gnu.org 2015-08-05 13:28 ` mwahab at gcc dot gnu.org 2015-08-05 13:40 ` mwahab at gcc dot gnu.org 2015-08-05 13:43 ` mwahab at gcc dot gnu.org 2015-09-30 3:07 ` ramana at gcc dot gnu.org 2015-10-05 8:08 ` mwahab at gcc dot gnu.org 2015-10-05 8:30 ` ramana at gcc dot gnu.org
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-65697-4-Rje62GECF6@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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).