PR 61713: ICE when expanding single-threaded version of atomic_test_and_set.
PR target/61713 * gcc/optabs.c (expand_atomic_test_and_set): Do not try to emit move to subtarget in serial version if result is ignored. PR target/61713 * gcc.dg/pr61756.c: New test. From-SVN: r213555
This commit is contained in:
parent
6d0b56ad0c
commit
0d03cda4fc
@ -1,3 +1,9 @@
|
||||
2014-08-04 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
|
||||
|
||||
PR target/61713
|
||||
* gcc/optabs.c (expand_atomic_test_and_set): Do not try to emit
|
||||
move to subtarget in serial version if result is ignored.
|
||||
|
||||
2014-07-14 Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>
|
||||
Kyrylo Tkachov <kyrylo.tkachov@arm.com>
|
||||
|
||||
|
@ -7356,7 +7356,10 @@ expand_atomic_test_and_set (rtx target, rtx mem, enum memmodel model)
|
||||
perform the operation. */
|
||||
if (!ret)
|
||||
{
|
||||
emit_move_insn (subtarget, mem);
|
||||
/* If the result is ignored skip the move to target. */
|
||||
if (subtarget != const0_rtx)
|
||||
emit_move_insn (subtarget, mem);
|
||||
|
||||
emit_move_insn (mem, trueval);
|
||||
ret = subtarget;
|
||||
}
|
||||
|
@ -1,3 +1,8 @@
|
||||
2014-08-04 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
|
||||
|
||||
PR target/61713
|
||||
* gcc.dg/pr61756.c: New test.
|
||||
|
||||
2014-08-04 Tom de Vries <tom@codesourcery.com>
|
||||
|
||||
* gcc.dg/cproj-fails-with-broken-glibc.c: Use xfail for broken glibc
|
||||
|
15
gcc/testsuite/gcc.dg/pr61756.c
Normal file
15
gcc/testsuite/gcc.dg/pr61756.c
Normal file
@ -0,0 +1,15 @@
|
||||
/* PR target/61756 */
|
||||
|
||||
/* { dg-do compile } */
|
||||
/* { dg-options "-O2" } */
|
||||
/* { dg-options "-O2 -march=armv5" { target arm*-*-* } } */
|
||||
|
||||
#include <stdatomic.h>
|
||||
|
||||
static volatile atomic_flag guard = ATOMIC_FLAG_INIT;
|
||||
|
||||
void
|
||||
try_atomic_flag_test_and_set (void)
|
||||
{
|
||||
atomic_flag_test_and_set (&guard);
|
||||
}
|
Loading…
Reference in New Issue
Block a user