aboutsummaryrefslogtreecommitdiff
path: root/gcc/config
diff options
context:
space:
mode:
authorUros Bizjak <ubizjak@gmail.com>2022-09-01 20:20:06 +0200
committerUros Bizjak <ubizjak@gmail.com>2022-09-01 20:20:43 +0200
commit5205f5b54ad769969ffd89978ba1bcee41380bf8 (patch)
tree0fc3e9ec207c7dd65d2f14c452f0805e16ea4701 /gcc/config
parentbb17c5030dc47c69c700e0fd0145285dc8f913a2 (diff)
downloadgcc-5205f5b54ad769969ffd89978ba1bcee41380bf8.zip
gcc-5205f5b54ad769969ffd89978ba1bcee41380bf8.tar.gz
gcc-5205f5b54ad769969ffd89978ba1bcee41380bf8.tar.bz2
i386: Fix conversion of move to/from AX_REG into xchg [PR106707]
The conversion of a move pattern where both operands are AX_REG should be prevented. 2022-09-01 Uroš Bizjak <ubizjak@gmail.com> gcc/ChangeLog: PR target/106707 * config/i386/i386.md (moves to/from AX_REG into xchg peephole2): Do not convert a move pattern where both operands are AX_REG. gcc/testsuite/ChangeLog: PR target/106707 * gcc.target/i386/pr106707.c: New test.
Diffstat (limited to 'gcc/config')
-rw-r--r--gcc/config/i386/i386.md4
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index a4a18cf..1aef1af 100644
--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -3043,8 +3043,8 @@
[(set (match_operand:SWI48 0 "general_reg_operand")
(match_operand:SWI48 1 "general_reg_operand"))]
"optimize_size > 1
- && (REGNO (operands[0]) == AX_REG
- || REGNO (operands[1]) == AX_REG)
+ && ((REGNO (operands[0]) == AX_REG)
+ != (REGNO (operands[1]) == AX_REG))
&& optimize_insn_for_size_p ()
&& peep2_reg_dead_p (1, operands[1])"
[(parallel [(set (match_dup 0) (match_dup 1))