summaryrefslogtreecommitdiff
path: root/gcc/config/i386/i386.md
diff options
context:
space:
mode:
authoruros <uros@138bc75d-0d04-0410-961f-82ee72b054a4>2013-01-10 19:49:17 +0000
committeruros <uros@138bc75d-0d04-0410-961f-82ee72b054a4>2013-01-10 19:49:17 +0000
commit91f28fc1c95f7bb9e3986a717c3ef5091f9206a5 (patch)
tree9a47d49d02dc90320186ca2c7a7c8044df8efbde /gcc/config/i386/i386.md
parent115e3f9b2615bbe7bce75e4d29638e977c10ac86 (diff)
downloadgcc-91f28fc1c95f7bb9e3986a717c3ef5091f9206a5.tar.gz
PR target/55929
* config/i386/i386.md (xbegin): Use %eax as a temporary register. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@195094 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/i386/i386.md')
-rw-r--r--gcc/config/i386/i386.md11
1 files changed, 7 insertions, 4 deletions
diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index 95a52cdd1a7..8fd1f915d90 100644
--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -18013,19 +18013,22 @@
(define_expand "xbegin"
[(set (match_operand:SI 0 "register_operand")
- (unspec_volatile:SI [(match_dup 1)] UNSPECV_XBEGIN))]
+ (unspec_volatile:SI [(const_int 0)] UNSPECV_XBEGIN))]
"TARGET_RTM"
{
rtx label = gen_label_rtx ();
- operands[1] = force_reg (SImode, constm1_rtx);
+ /* xbegin is emitted as jump_insn, so reload won't be able
+ to reload its operand. Force the value into AX hard register. */
+ rtx ax_reg = gen_rtx_REG (SImode, AX_REG);
+ emit_move_insn (ax_reg, constm1_rtx);
- emit_jump_insn (gen_xbegin_1 (operands[1], label));
+ emit_jump_insn (gen_xbegin_1 (ax_reg, label));
emit_label (label);
LABEL_NUSES (label) = 1;
- emit_move_insn (operands[0], operands[1]);
+ emit_move_insn (operands[0], ax_reg);
DONE;
})