Commit 8673b671 by Andrew MacLeod Committed by Andrew Macleod

re PR middle-end/59448 (Code generation doesn't respect C11 address-dependency)


2015-01-14  Andrew MacLeod  <amacleod@redhat.com>

	PR middle-end/59448
	* builtins.c (get_memmodel): Promote consume to acquire always.
	* testsuite/gcc.dg/atomic-invalid.c: Remove obselete test for illegal
	consume in an atomic_exchange.

From-SVN: r219601
parent 4b54ab97
2015-01-14 Andrew MacLeod <amacleod@redhat.com>
PR middle-end/59448
* builtins.c (get_memmodel): Promote consume to acquire always.
2014-01-14 Ilya Tocar <ilya.tocar@intel.com> 2014-01-14 Ilya Tocar <ilya.tocar@intel.com>
PR target/64386 PR target/64386
......
...@@ -5365,6 +5365,11 @@ get_memmodel (tree exp) ...@@ -5365,6 +5365,11 @@ get_memmodel (tree exp)
return MEMMODEL_SEQ_CST; return MEMMODEL_SEQ_CST;
} }
/* Workaround for Bugzilla 59448. GCC doesn't track consume properly, so
be conservative and promote consume to acquire. */
if (val == MEMMODEL_CONSUME)
val = MEMMODEL_ACQUIRE;
return (enum memmodel) val; return (enum memmodel) val;
} }
......
2015-01-14 Andrew MacLeod <amacleod@redhat.com>
PR middle-end/59448
* gcc.dg/atomic-invalid.c: Remove obselete test for illegal consume in
an atomic_exchange.
2014-01-14 Ilya Tocar <ilya.tocar@intel.com> 2014-01-14 Ilya Tocar <ilya.tocar@intel.com>
PR target/64386 PR target/64386
......
...@@ -17,8 +17,6 @@ main () ...@@ -17,8 +17,6 @@ main ()
__atomic_compare_exchange_n (&i, &e, 1, 0, __ATOMIC_SEQ_CST, __ATOMIC_RELEASE); /* { dg-error "invalid failure memory" } */ __atomic_compare_exchange_n (&i, &e, 1, 0, __ATOMIC_SEQ_CST, __ATOMIC_RELEASE); /* { dg-error "invalid failure memory" } */
__atomic_compare_exchange_n (&i, &e, 1, 1, __ATOMIC_SEQ_CST, __ATOMIC_ACQ_REL); /* { dg-error "invalid failure memory" } */ __atomic_compare_exchange_n (&i, &e, 1, 1, __ATOMIC_SEQ_CST, __ATOMIC_ACQ_REL); /* { dg-error "invalid failure memory" } */
__atomic_exchange_n (&i, 1, __ATOMIC_CONSUME); /* { dg-error "invalid memory model" } */
__atomic_load_n (&i, __ATOMIC_RELEASE); /* { dg-error "invalid memory model" } */ __atomic_load_n (&i, __ATOMIC_RELEASE); /* { dg-error "invalid memory model" } */
__atomic_load_n (&i, __ATOMIC_ACQ_REL); /* { dg-error "invalid memory model" } */ __atomic_load_n (&i, __ATOMIC_ACQ_REL); /* { dg-error "invalid memory model" } */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment