]> git.ipfire.org Git - thirdparty/gcc.git/commit
rs6000: Teach rs6000_opaque_type_invalid_use_p about inline asm [PR108272]
authorKewen Lin <linkw@linux.ibm.com>
Sun, 12 Feb 2023 15:35:27 +0000 (09:35 -0600)
committerKewen Lin <linkw@linux.ibm.com>
Mon, 13 Feb 2023 02:14:18 +0000 (20:14 -0600)
commitec4d91aa885297c3b5bb4bbfb3133ffe2e5e6a2f
treec9552847fee5e87da4551790572697dbf9985e20
parent80f9bda6cc2fc35e019a04336ada77feca72b5e0
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.c (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)
gcc/config/rs6000/rs6000.c
gcc/testsuite/gcc.target/powerpc/pr108272-1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/powerpc/pr108272-2.c [new file with mode: 0644]
gcc/testsuite/gcc.target/powerpc/pr108272-3.c [new file with mode: 0644]
gcc/testsuite/gcc.target/powerpc/pr108272-4.c [new file with mode: 0644]