From: jgreenhalgh Date: Fri, 5 Jun 2015 08:47:44 +0000 (+0000) Subject: [Patch] The comparison in a compare exchange should not take place in VOIDmode X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=62589f76c4184aed77f0628313d2391e23b91548;p=thirdparty%2Fgcc.git [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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@224148 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5eb2f40239e6..6a6707f61ffa 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2015-06-05 James Greenhalgh + + * builtins.c (expand_builtin_atomic_compare_exchange): Call + emit_cmp_and_jump_insns with the mode of target. + 2015-06-05 Venkataramanan Kumar * config/i386/sse.md (sse3_mwait): Swap the operand constriants. diff --git a/gcc/builtins.c b/gcc/builtins.c index f20608b29e9d..8772158af94b 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);