2019-11-19 Jakub Jelinek <jakub@redhat.com>
+ PR target/92549
+ * config/i386/i386.md (peephole2 for *swap<mode>): New peephole2.
+
PR middle-end/91450
* internal-fn.c (expand_mul_overflow): For s1 * s2 -> ur, if one
operand is negative and one non-negative, compare the non-negative
(set_attr "amdfam10_decode" "double")
(set_attr "bdver1_decode" "double")])
+(define_peephole2
+ [(set (match_operand:SWI 0 "register_operand")
+ (match_operand:SWI 1 "register_operand"))
+ (set (match_dup 1)
+ (match_operand:SWI 2 "register_operand"))
+ (set (match_dup 2) (match_dup 0))]
+ "peep2_reg_dead_p (3, operands[0])
+ && optimize_insn_for_size_p ()"
+ [(parallel [(set (match_dup 1) (match_dup 2))
+ (set (match_dup 2) (match_dup 1))])])
+
(define_expand "movstrict<mode>"
[(set (strict_low_part (match_operand:SWI12 0 "register_operand"))
(match_operand:SWI12 1 "general_operand"))]
2019-11-19 Jakub Jelinek <jakub@redhat.com>
+ PR target/92549
+ * gcc.target/i386/pr92549.c: New test.
+
PR middle-end/91450
* gcc.c-torture/execute/pr91450-1.c: New test.
* gcc.c-torture/execute/pr91450-2.c: New test.
--- /dev/null
+/* PR target/92549 */
+/* { dg-do compile } */
+/* { dg-options "-Os -masm=att" } */
+/* { dg-additional-options "-mregparm=2" { target ia32 } } */
+/* { dg-final { scan-assembler "xchgl" } } */
+
+__attribute__((noipa)) int
+bar (int a, int b)
+{
+ return b - a + 5;
+}
+
+int
+foo (int a, int b)
+{
+ return 1 + bar (b, a);
+}