]> git.ipfire.org Git - people/ms/gcc.git/commit
rs6000: Teach rs6000_opaque_type_invalid_use_p about gcall [PR108348]
authorKewen Lin <linkw@linux.ibm.com>
Wed, 18 Jan 2023 08:34:19 +0000 (02:34 -0600)
committerKewen Lin <linkw@linux.ibm.com>
Mon, 13 Feb 2023 02:06:43 +0000 (20:06 -0600)
commit0e41d8a77887b838de5493c491f411274376227a
tree5bfe9419601c7ca3c94f4dc4285914e5f22edf34
parent79a81d526babb6ffb6d85b4a05b29269470ab49d
rs6000: Teach rs6000_opaque_type_invalid_use_p about gcall [PR108348]

PR108348 shows one special case that MMA opaque types are
used in function arguments and treated as pass by reference,
it results in one copying from argument to a temp variable,
since this copying happens before rs6000_function_arg check,
it can cause ICE without MMA support then.  This patch is to
teach function rs6000_opaque_type_invalid_use_p to check if
any function argument in a gcall stmt has the invalid use of
MMA opaque types.

btw, I checked the handling on return value, it doesn't have
this kind of issue as its checking and error emission is quite
early, so this doesn't handle function return value.

PR target/108348

gcc/ChangeLog:

* config/rs6000/rs6000.c (rs6000_opaque_type_invalid_use_p): Add the
support for invalid uses of MMA opaque type in function arguments.

gcc/testsuite/ChangeLog:

* gcc.target/powerpc/pr108348-1.c: New test.
* gcc.target/powerpc/pr108348-2.c: New test.

(cherry picked from commit 5d9529687deb9ed009361a16c02a7f6c3e2ebbf3)
gcc/config/rs6000/rs6000.c
gcc/testsuite/gcc.target/powerpc/pr108348-1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/powerpc/pr108348-2.c [new file with mode: 0644]