From: Jakub Jelinek Date: Thu, 8 Mar 2018 20:55:03 +0000 (+0100) Subject: re PR inline-asm/84742 (internal compiler error: in process_alt_operands, at lra... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=86c6352c2f6d1d6dac28620d98593e4afe7ae89f;p=gcc.git re PR inline-asm/84742 (internal compiler error: in process_alt_operands, at lra-constraints.c:2112) 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 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a467d7bafaf..78b8fc4643e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2018-03-08 Jakub Jelinek + + 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 PR target/84748 diff --git a/gcc/recog.c b/gcc/recog.c index af6a6b01d88..0e26c93162b 100644 --- a/gcc/recog.c +++ b/gcc/recog.c @@ -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; } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 8b6d0e53c5e..32740bf3710 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2018-03-08 Jakub Jelinek + + 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 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 index 00000000000..07b822f3112 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr84742-1.c @@ -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 index 00000000000..7ac9cea675c --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr84742-2.c @@ -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'" } */ +}