public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Kewen.Lin" <linkw@linux.ibm.com>
To: Segher Boessenkool <segher@kernel.crashing.org>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>,
	David Edelsohn <dje.gcc@gmail.com>,
	Peter Bergner <bergner@linux.ibm.com>
Subject: Re: [PATCH] rs6000: Teach rs6000_opaque_type_invalid_use_p about gcall [PR108348]
Date: Mon, 16 Jan 2023 17:20:56 +0800	[thread overview]
Message-ID: <c6c52a5b-03c6-c50c-59b1-f41630d4b39f@linux.ibm.com> (raw)
In-Reply-To: <20230116084907.GE25951@gate.crashing.org>

Hi Segher,

Thanks for the review comments!

on 2023/1/16 16:49, Segher Boessenkool wrote:
> Hi!
> 
> On Mon, Jan 16, 2023 at 04:33:36PM +0800, Kewen.Lin wrote:
>> 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.
>>
>> Bootstrapped and regtested on powerpc64-linux-gnu P8 and
>> powerpc64le-linux-gnu P9 and P10.
>>
>> I'm going to push this soon if no objections.
> 
> Looks okay.  Some testcase stuff though:
> 
>> --- /dev/null
>> +++ b/gcc/testsuite/gcc.target/powerpc/pr108348-1.c
>> @@ -0,0 +1,23 @@
>> +/* { dg-require-effective-target powerpc_p9modulo_ok } */
> 
> Please use a saner selector?  If one doesn't exist yet, make a new one?
> Something that just says "p9", not "modulo".

The has_arch_pwr9 looks not suitable here as it doesn't check
the assembler behavior?  Do you have some instruction in mind
for being used as the tested instruction mnemonic like modsw?

Maybe later we can deprecate -mmodulo like we get rid of
-mdirect-move, then we can rename p9modulo_ok to p9_ok here?  :)

BR,
Kewen

  reply	other threads:[~2023-01-16  9:21 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-16  8:33 Kewen.Lin
2023-01-16  8:49 ` Segher Boessenkool
2023-01-16  9:20   ` Kewen.Lin [this message]
2023-01-16 10:40     ` Segher Boessenkool
2023-01-16 13:05       ` Kewen.Lin
2023-01-16 15:24         ` Segher Boessenkool
2023-01-17  2:48           ` Kewen.Lin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c6c52a5b-03c6-c50c-59b1-f41630d4b39f@linux.ibm.com \
    --to=linkw@linux.ibm.com \
    --cc=bergner@linux.ibm.com \
    --cc=dje.gcc@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=segher@kernel.crashing.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).