diff options
author | Kewen Lin <linkw@linux.ibm.com> | 2023-01-16 02:15:39 -0600 |
---|---|---|
committer | Kewen Lin <linkw@linux.ibm.com> | 2023-02-12 20:00:40 -0600 |
commit | e5a63c986978699a25f4bfb9b58a0111951e7d43 (patch) | |
tree | b6c490772f7f4202e9289c5ac0e181798f5ed2ea /gcc/testsuite/gcc.target | |
parent | b9f5d34ddc17e990e2d21929b25999d56493c3e0 (diff) | |
download | gcc-e5a63c986978699a25f4bfb9b58a0111951e7d43.zip gcc-e5a63c986978699a25f4bfb9b58a0111951e7d43.tar.gz gcc-e5a63c986978699a25f4bfb9b58a0111951e7d43.tar.bz2 |
rs6000: Teach rs6000_opaque_type_invalid_use_p about inline asm [PR108272]
As PR108272 shows, there are some invalid uses of MMA opaque
types in inline asm statements. This patch is to teach the
function rs6000_opaque_type_invalid_use_p for inline asm,
check and error any invalid use of MMA opaque types in input
and output operands.
PR target/108272
gcc/ChangeLog:
* config/rs6000/rs6000.cc (rs6000_opaque_type_invalid_use_p): Add the
support for invalid uses in inline asm, factor out the checking and
erroring to lambda function check_and_error_invalid_use.
gcc/testsuite/ChangeLog:
* gcc.target/powerpc/pr108272-1.c: New test.
* gcc.target/powerpc/pr108272-2.c: New test.
* gcc.target/powerpc/pr108272-3.c: New test.
* gcc.target/powerpc/pr108272-4.c: New test.
(cherry picked from commit 074b0c03eabeb8e9c8de813c81bf87a1f88fdb65)
Diffstat (limited to 'gcc/testsuite/gcc.target')
-rw-r--r-- | gcc/testsuite/gcc.target/powerpc/pr108272-1.c | 17 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/powerpc/pr108272-2.c | 17 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/powerpc/pr108272-3.c | 17 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/powerpc/pr108272-4.c | 18 |
4 files changed, 69 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.target/powerpc/pr108272-1.c b/gcc/testsuite/gcc.target/powerpc/pr108272-1.c new file mode 100644 index 0000000..b99e6a4 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/pr108272-1.c @@ -0,0 +1,17 @@ +/* { dg-require-effective-target powerpc_p9modulo_ok } */ +/* If the default cpu type is power10 or later, type __vector_quad is + supported. To keep the test point available all the time, this case + specifies -mdejagnu-cpu=power9 here. */ +/* { dg-options "-mdejagnu-cpu=power9" } */ + +/* Verify there is no ICE and don't check the error messages on unsupported + type since they could be fragile and are not test points of this case. */ + +/* { dg-excess-errors "pr108272-1" } */ + +void +foo (void) +{ + __vector_quad acc; + asm("#..." : "=d"(acc)); +} diff --git a/gcc/testsuite/gcc.target/powerpc/pr108272-2.c b/gcc/testsuite/gcc.target/powerpc/pr108272-2.c new file mode 100644 index 0000000..51b2100 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/pr108272-2.c @@ -0,0 +1,17 @@ +/* { dg-require-effective-target powerpc_p9modulo_ok } */ +/* If the default cpu type is power10 or later, type __vector_pair is + supported. To keep the test point available all the time, this case + specifies -mdejagnu-cpu=power9 here. */ +/* { dg-options "-mdejagnu-cpu=power9" } */ + +/* Verify there is no ICE and don't check the error messages on unsupported + type since they could be fragile and are not test points of this case. */ + +/* { dg-excess-errors "pr108272-2" } */ + +void +foo (void) +{ + __vector_pair acc; + asm("#..." :: "d"(acc)); +} diff --git a/gcc/testsuite/gcc.target/powerpc/pr108272-3.c b/gcc/testsuite/gcc.target/powerpc/pr108272-3.c new file mode 100644 index 0000000..634a529 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/pr108272-3.c @@ -0,0 +1,17 @@ +/* { dg-require-effective-target powerpc_p9modulo_ok } */ +/* If the default cpu type is power10 or later, type __vector_quad is + supported. To keep the test point available all the time, this case + specifies -mdejagnu-cpu=power9 here. */ +/* { dg-options "-mdejagnu-cpu=power9" } */ + +/* Verify there is no ICE and don't check the error messages on unsupported + type since they could be fragile and are not test points of this case. */ + +/* { dg-excess-errors "pr108272-3" } */ + +void +foo (void) +{ + volatile __vector_quad acc; + asm("#..." : "=d"(acc)); +} diff --git a/gcc/testsuite/gcc.target/powerpc/pr108272-4.c b/gcc/testsuite/gcc.target/powerpc/pr108272-4.c new file mode 100644 index 0000000..7eecd6c --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/pr108272-4.c @@ -0,0 +1,18 @@ +/* { dg-require-effective-target powerpc_p9modulo_ok } */ +/* If the default cpu type is power10 or later, type __vector_pair is + supported. To keep the test point available all the time, this case + specifies -mdejagnu-cpu=power9 here. */ +/* { dg-options "-mdejagnu-cpu=power9" } */ + +/* Verify there is no ICE and don't check the error messages on unsupported + type since they could be fragile and are not test points of this case. */ + +/* { dg-excess-errors "pr108272-4" } */ + +typedef __vector_pair vpair_t; +void +foo (void) +{ + vpair_t acc; + asm("#..." : "=d"(acc)); +} |