re PR target/92744 (error: insn does not satisfy its constraints since r278439)
authorUros Bizjak <ubizjak@gmail.com>
Tue, 3 Dec 2019 08:23:06 +0000 (09:23 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Tue, 3 Dec 2019 08:23:06 +0000 (09:23 +0100)
PR target/92744
* config/i386/i386.md (peephole2 for *swap<mode>): Use
general_reg_operand predicates instead of register_operand.

* g++.dg/dfp/pr92744.C: New test.

From-SVN: r278924

gcc/ChangeLog
gcc/config/i386/i386.md
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/dfp/pr92744.C [new file with mode: 0644]

index e06244ccaf8a9e0679c933730857f3128f7c8b37..a89c4352aa324af6219749669b6fbbf87dc36df1 100644 (file)
@@ -1,3 +1,10 @@
+2019-12-03  Uroš Bizjak  <ubizjak@gmail.com>
+           Jakub Jelinek  <jakub@redhat.com>
+
+       PR target/92744
+       * config/i386/i386.md (peephole2 for *swap<mode>): Use
+       general_reg_operand predicates instead of register_operand.
+
 2019-12-03  Richard Biener  <rguenther@suse.de>
 
        PR tree-optimization/92645
index 7ff5872ba436c9adc6393f57a9958fc57e80de7e..2d43992724fa222fc1a3b20462633d7074364765 100644 (file)
    (set_attr "bdver1_decode" "double")])
 
 (define_peephole2
-  [(set (match_operand:SWI 0 "register_operand")
-       (match_operand:SWI 1 "register_operand"))
+  [(set (match_operand:SWI 0 "general_reg_operand")
+       (match_operand:SWI 1 "general_reg_operand"))
    (set (match_dup 1)
-       (match_operand:SWI 2 "register_operand"))
+       (match_operand:SWI 2 "general_reg_operand"))
    (set (match_dup 2) (match_dup 0))]
   "peep2_reg_dead_p (3, operands[0])
    && optimize_insn_for_size_p ()"
index 9b0d0a36327ead9ecdf0f706cae61f9c5de4ad29..2d8c350d57574f297a9167b084b79525901766e8 100644 (file)
@@ -1,5 +1,8 @@
 2019-12-03  Jakub Jelinek  <jakub@redhat.com>
 
+       PR target/92744
+       * g++.dg/dfp/pr92744.C: New test.
+
        PR c++/92732
        * g++.dg/cpp2a/bitfield3.C: Don't expect narrowing conversion
        warnings.
diff --git a/gcc/testsuite/g++.dg/dfp/pr92744.C b/gcc/testsuite/g++.dg/dfp/pr92744.C
new file mode 100644 (file)
index 0000000..5026e8d
--- /dev/null
@@ -0,0 +1,20 @@
+// PR target/92744
+// { dg-do compile }
+// { dg-options "-Os -fno-tree-ccp" }
+
+typedef float T __attribute__((mode(SD)));
+struct A { T a; };
+void foo ();
+
+bool
+operator!= (A x, A y)
+{
+  return x.a != y.a;
+}
+
+void
+bar (A x, A y)
+{
+  if (x != y)
+    foo ();
+}