re PR inline-asm/84742 (internal compiler error: in process_alt_operands, at lra...
authorJakub Jelinek <jakub@redhat.com>
Thu, 8 Mar 2018 20:55:03 +0000 (21:55 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Thu, 8 Mar 2018 20:55:03 +0000 (21:55 +0100)
PR inline-asm/84742
* recog.c (asm_operand_ok): Return 0 if multi-character constraint
has ',' character inside of it.

* gcc.target/i386/pr84742-1.c: New test.
* gcc.target/i386/pr84742-2.c: New test.

From-SVN: r258369

gcc/ChangeLog
gcc/recog.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/i386/pr84742-1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/pr84742-2.c [new file with mode: 0644]

index a467d7b..78b8fc4 100644 (file)
@@ -1,3 +1,9 @@
+2018-03-08  Jakub Jelinek  <jakub@redhat.com>
+
+       PR inline-asm/84742
+       * recog.c (asm_operand_ok): Return 0 if multi-character constraint
+       has ',' character inside of it.
+
 2018-03-08  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>
 
        PR target/84748
index af6a6b0..0e26c93 100644 (file)
@@ -1825,7 +1825,7 @@ asm_operand_ok (rtx op, const char *constraint, const char **constraints)
       len = CONSTRAINT_LEN (c, constraint);
       do
        constraint++;
-      while (--len && *constraint);
+      while (--len && *constraint && *constraint != ',');
       if (len)
        return 0;
     }
index 8b6d0e5..32740bf 100644 (file)
@@ -1,3 +1,9 @@
+2018-03-08  Jakub Jelinek  <jakub@redhat.com>
+
+       PR inline-asm/84742
+       * gcc.target/i386/pr84742-1.c: New test.
+       * gcc.target/i386/pr84742-2.c: New test.
+
 2018-03-08  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>
 
        PR target/84748
diff --git a/gcc/testsuite/gcc.target/i386/pr84742-1.c b/gcc/testsuite/gcc.target/i386/pr84742-1.c
new file mode 100644 (file)
index 0000000..07b822f
--- /dev/null
@@ -0,0 +1,10 @@
+/* PR inline-asm/84742 */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+void 
+foo ()
+{
+  char b = 1;
+  asm volatile ("" : "+T,Y" (b));      /* { dg-error "impossible constraint in 'asm'" } */
+}
diff --git a/gcc/testsuite/gcc.target/i386/pr84742-2.c b/gcc/testsuite/gcc.target/i386/pr84742-2.c
new file mode 100644 (file)
index 0000000..7ac9cea
--- /dev/null
@@ -0,0 +1,10 @@
+/* PR inline-asm/84742 */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+void 
+foo ()
+{
+  char b = 1;
+  asm volatile ("" : "+gT,m" (b));     /* { dg-error "impossible constraint in 'asm'" } */
+}