aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJames Greenhalgh <james.greenhalgh@arm.com>2015-06-05 08:47:44 +0000
committerJames Greenhalgh <jgreenhalgh@gcc.gnu.org>2015-06-05 08:47:44 +0000
commitf8940d4a097beb106a325878010e5467f5c6f6d5 (patch)
tree82d9c2575620e32072c7edef398aa1b818a54acb /gcc
parentedf1fd6defa3ed02f1079376b0eecd51cbcb3e44 (diff)
downloadgcc-f8940d4a097beb106a325878010e5467f5c6f6d5.zip
gcc-f8940d4a097beb106a325878010e5467f5c6f6d5.tar.gz
gcc-f8940d4a097beb106a325878010e5467f5c6f6d5.tar.bz2
[Patch] The comparison in a compare exchange should not take place in VOIDmode
gcc/ * builtins.c (expand_builtin_atomic_compare_exchange): Call emit_cmp_and_jump_insns with the mode of target. From-SVN: r224148
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/builtins.c3
2 files changed, 7 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 5eb2f40..6a6707f 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2015-06-05 James Greenhalgh <james.greenhalgh@arm.com>
+
+ * builtins.c (expand_builtin_atomic_compare_exchange): Call
+ emit_cmp_and_jump_insns with the mode of target.
+
2015-06-05 Venkataramanan Kumar <venkataramanan.kumar@amd.com>
* config/i386/sse.md (sse3_mwait): Swap the operand constriants.
diff --git a/gcc/builtins.c b/gcc/builtins.c
index f20608b2..8772158 100644
--- a/gcc/builtins.c
+++ b/gcc/builtins.c
@@ -5471,7 +5471,8 @@ expand_builtin_atomic_compare_exchange (machine_mode mode, tree exp,
the normal case where EXPECT is totally private, i.e. a register. At
which point the store can be unconditional. */
label = gen_label_rtx ();
- emit_cmp_and_jump_insns (target, const0_rtx, NE, NULL, VOIDmode, 1, label);
+ emit_cmp_and_jump_insns (target, const0_rtx, NE, NULL,
+ GET_MODE (target), 1, label);
emit_move_insn (expect, oldval);
emit_label (label);