[Patch] The comparison in a compare exchange should not take place in VOIDmode
authorJames Greenhalgh <james.greenhalgh@arm.com>
Fri, 5 Jun 2015 08:47:44 +0000 (08:47 +0000)
committerJames Greenhalgh <jgreenhalgh@gcc.gnu.org>
Fri, 5 Jun 2015 08:47:44 +0000 (08:47 +0000)
gcc/

* builtins.c (expand_builtin_atomic_compare_exchange): Call
emit_cmp_and_jump_insns with the mode of target.

From-SVN: r224148

gcc/ChangeLog
gcc/builtins.c

index 5eb2f40239e69007ac18208d998a7ec738fa41ab..6a6707f61ffa4b09387fab8bc17eed14f9c54596 100644 (file)
@@ -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.
index f20608b29e9d71d2202997365f0ace635204799e..8772158af94b572483d34525f7870b8431ac0c99 100644 (file)
@@ -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);