re PR rtl-optimization/91223 (ICE: in curr_insn_transform, at lra-constraints.c:4459)
authorVladimir Makarov <vmakarov@redhat.com>
Thu, 25 Jul 2019 18:36:52 +0000 (18:36 +0000)
committerVladimir Makarov <vmakarov@gcc.gnu.org>
Thu, 25 Jul 2019 18:36:52 +0000 (18:36 +0000)
2019-07-25  Vladimir Makarov  <vmakarov@redhat.com>

PR rtl-optimization/91223
* lra-constraints.c (process_alt_operands): Fail for unsuccessful
matching with INOUT operand.

2019-07-25  Vladimir Makarov  <vmakarov@redhat.com>

PR rtl-optimization/91223
* gcc.target/i386/pr91223.c: New test.

From-SVN: r273810

gcc/ChangeLog
gcc/lra-constraints.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/i386/pr91223.c [new file with mode: 0644]

index 336e9eef2c32a1be2b3d843d9c6d6a5ddb7663ee..42beda4e64392c7c68717251028053d9ae6d9b84 100644 (file)
@@ -1,3 +1,9 @@
+2019-07-25  Vladimir Makarov  <vmakarov@redhat.com>
+
+       PR rtl-optimization/91223
+       * lra-constraints.c (process_alt_operands): Fail for unsuccessful
+       matching with INOUT operand.
+
 2019-07-25  Eric Botcazou  <ebotcazou@adacore.com>
 
        * stmt.c (expand_case): Try to narrow the index type if it's larger
index 55d8d133d3941bbf7cca478ad28c5dc6f9d6e658..bd9f85d33cc67ca3ce147fed2d3d3b137352c9bd 100644 (file)
@@ -2171,6 +2171,14 @@ process_alt_operands (int only_alternative)
                      }
                    else
                      {
+                       /* If the operands do not match and one
+                          operand is INOUT, we can not match them.
+                          Try other possibilities, e.g. other
+                          alternatives or commutative operand
+                          exchange.  */
+                       if (curr_static_id->operand[nop].type == OP_INOUT
+                           || curr_static_id->operand[m].type == OP_INOUT)
+                         break;
                        /* Operands don't match.  If the operands are
                           different user defined explicit hard
                           registers, then we cannot make them match
index 6fc49316c8a57d4fda869095887169ef2a3af2a3..0ff528b87b3cab566384ac50e625af9f63c92534 100644 (file)
@@ -1,3 +1,8 @@
+2019-07-25  Vladimir Makarov  <vmakarov@redhat.com>
+
+       PR rtl-optimization/91223
+       * gcc.target/i386/pr91223.c: New test.
+
 2019-07-25  Iain Sandoe  <iain@sandoe.co.uk>
 
        PR gcov-profile/91087
diff --git a/gcc/testsuite/gcc.target/i386/pr91223.c b/gcc/testsuite/gcc.target/i386/pr91223.c
new file mode 100644 (file)
index 0000000..1b9e85b
--- /dev/null
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-options "-Og -fno-tree-fre" } */
+int a;
+void fn2(short, short);
+
+void fn1(void) {
+  short b[8];
+  b[0] |= a & 3;
+  b[1] = a;
+  fn2(b[0], b[1]);
+}