2014-08-11 Yvan Roux <yvan.roux@linaro.org>
Backport from trunk r213555.
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.
gcc/testsuite
2014-08-11 Yvan Roux <yvan.roux@linaro.org>
Backport from trunk r213555.
2014-08-04 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
PR target/61713
* gcc.dg/pr61756.c: New test.
git-svn-id: svn://gcc.gnu.org/svn/gcc/branches/linaro/gcc-4_9-branch@213801
138bc75d-0d04-0410-961f-
82ee72b054a4
2014-08-11 Yvan Roux <yvan.roux@linaro.org>
+ Backport from trunk r213555.
+ 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-08-11 Yvan Roux <yvan.roux@linaro.org>
+
Backport from trunk r213376.
2014-07-31 Charles Baylis <charles.baylis@linaro.org>
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;
}
2014-08-11 Yvan Roux <yvan.roux@linaro.org>
+ Backport from trunk r213555.
+ 2014-08-04 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
+
+ PR target/61713
+ * gcc.dg/pr61756.c: New test.
+
+2014-08-11 Yvan Roux <yvan.roux@linaro.org>
Backport from trunk r213376.
2014-07-31 Charles Baylis <charles.baylis@linaro.org>
--- /dev/null
+/* 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);
+}