From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) by sourceware.org (Postfix) with ESMTP id 99A3B3858D33 for ; Mon, 16 Jan 2023 08:50:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 99A3B3858D33 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=kernel.crashing.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=kernel.crashing.org Received: from gate.crashing.org (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id 30G8n7KE011433; Mon, 16 Jan 2023 02:49:07 -0600 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id 30G8n7O6011432; Mon, 16 Jan 2023 02:49:07 -0600 X-Authentication-Warning: gate.crashing.org: segher set sender to segher@kernel.crashing.org using -f Date: Mon, 16 Jan 2023 02:49:07 -0600 From: Segher Boessenkool To: "Kewen.Lin" Cc: GCC Patches , David Edelsohn , Peter Bergner Subject: Re: [PATCH] rs6000: Teach rs6000_opaque_type_invalid_use_p about gcall [PR108348] Message-ID: <20230116084907.GE25951@gate.crashing.org> References: <1ea87e1b-7caf-59dd-ff1a-8f282a2dae14@linux.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1ea87e1b-7caf-59dd-ff1a-8f282a2dae14@linux.ibm.com> User-Agent: Mutt/1.4.2.3i X-Spam-Status: No, score=-3.0 required=5.0 tests=BAYES_00,JMQ_SPF_NEUTRAL,KAM_DMARC_STATUS,KAM_SHORT,SPF_HELO_PASS,SPF_PASS,TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: 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". Thanks, Segher