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 a467d7bafafeace7d2eac03859c8025637739c20..78b8fc4643ec873c7748bf1ba604e3bfdfd6cd95 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 af6a6b01d88cea8fb843cc8a1e5467d062c0f9ed..0e26c93162b1d33631d44d7af2f304e5b5360f21 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 8b6d0e53c5eb2b127c3c9b7a759c50f53ddd71ae..32740bf37100cb66d5bc025de6ae195bacf78dcc 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'" } */
+}