Message ID | 59bd5fac-48d3-472f-1acb-b36bb11a34d7@linux.ibm.com |
---|---|
State | New |
Headers |
Return-Path: <gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C882C3858032 for <patchwork@sourceware.org>; Mon, 13 Dec 2021 16:16:22 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C882C3858032 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1639412182; bh=Ueyz11ijDPEn9zNyMfSph3bJmrM7vyqwDYBALRE172M=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=S1GWBHJp7xoO8iTj7KohMmWhzRDynZcoHnPzyu572nOvD4RXWHr6bMaKYa68+Zw05 IX6auWiujnbFMhmoCSAh8VWBMK6naKNb/CmfJiwvsNaF2MHCBufLqoQFt4ZtQVUKD2 s++U8RkP2Vt19cmahk8NJz7oTnvIhXrceA/U8re4= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by sourceware.org (Postfix) with ESMTPS id 8B1563858D39 for <gcc-patches@gcc.gnu.org>; Mon, 13 Dec 2021 16:15:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 8B1563858D39 Received: from pps.filterd (m0098409.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 1BDEvUa2019545; Mon, 13 Dec 2021 16:15:51 GMT Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 3cx8d5hx7q-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 13 Dec 2021 16:15:51 +0000 Received: from m0098409.ppops.net (m0098409.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 1BDEvqFn024190; Mon, 13 Dec 2021 16:15:50 GMT Received: from ppma05wdc.us.ibm.com (1b.90.2fa9.ip4.static.sl-reverse.com [169.47.144.27]) by mx0a-001b2d01.pphosted.com with ESMTP id 3cx8d5hx76-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 13 Dec 2021 16:15:50 +0000 Received: from pps.filterd (ppma05wdc.us.ibm.com [127.0.0.1]) by ppma05wdc.us.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 1BDGEA9a012365; Mon, 13 Dec 2021 16:15:49 GMT Received: from b01cxnp22034.gho.pok.ibm.com (b01cxnp22034.gho.pok.ibm.com [9.57.198.24]) by ppma05wdc.us.ibm.com with ESMTP id 3cvkm9sexu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 13 Dec 2021 16:15:49 +0000 Received: from b01ledav001.gho.pok.ibm.com (b01ledav001.gho.pok.ibm.com [9.57.199.106]) by b01cxnp22034.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 1BDGFmQn18219276 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 13 Dec 2021 16:15:48 GMT Received: from b01ledav001.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 2FEB628064; Mon, 13 Dec 2021 16:15:48 +0000 (GMT) Received: from b01ledav001.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9BA5D28071; Mon, 13 Dec 2021 16:15:47 +0000 (GMT) Received: from [9.211.120.142] (unknown [9.211.120.142]) by b01ledav001.gho.pok.ibm.com (Postfix) with ESMTP; Mon, 13 Dec 2021 16:15:47 +0000 (GMT) Message-ID: <59bd5fac-48d3-472f-1acb-b36bb11a34d7@linux.ibm.com> Date: Mon, 13 Dec 2021 10:15:46 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.4.0 To: GCC Patches <gcc-patches@gcc.gnu.org> Subject: [PATCH] rs6000: Skip overload instances with uninitialized fntype (PR103622) Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: 0B_-Gw80Zc56-7pDyHVyTYvSRvz_SINM X-Proofpoint-GUID: OHuCYmLQVS0sQN5N_8qVCih_8QfFhmPc X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.790,Hydra:6.0.425,FMLib:17.11.62.513 definitions=2021-12-13_08,2021-12-13_01,2021-12-02_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 impostorscore=0 adultscore=0 mlxscore=0 lowpriorityscore=0 malwarescore=0 suspectscore=0 priorityscore=1501 clxscore=1015 mlxlogscore=999 spamscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2110150000 definitions=main-2112130103 X-Spam-Status: No, score=-12.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list <gcc-patches.gcc.gnu.org> List-Unsubscribe: <https://gcc.gnu.org/mailman/options/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe> List-Archive: <https://gcc.gnu.org/pipermail/gcc-patches/> List-Post: <mailto:gcc-patches@gcc.gnu.org> List-Help: <mailto:gcc-patches-request@gcc.gnu.org?subject=help> List-Subscribe: <https://gcc.gnu.org/mailman/listinfo/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe> From: Bill Schmidt via Gcc-patches <gcc-patches@gcc.gnu.org> Reply-To: wschmidt@linux.ibm.com Cc: David Edelsohn <dje.gcc@gmail.com>, Segher Boessenkool <segher@kernel.crashing.org> Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" <gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org> |
Series |
rs6000: Skip overload instances with uninitialized fntype (PR103622)
|
|
Commit Message
Li, Pan2 via Gcc-patches
Dec. 13, 2021, 4:15 p.m. UTC
Hi! For some data types like IEEE-128, we determine whether the type is available at built-in function initialization time. If it's not, then we don't provide the function type for function instances that require the data type. PR103622 observes that this can cause us to ICE when running the list of instances when the target doesn't support the data type. Ideally, we wouldn't even put such an instance in the list of instances that an overload can map to, but to do that is much more complicated. Instead, this patch just ensures we don't dereference a NULL pointer when the situation arises. Tested the fix on a powerpc-e300c3-linux-gnu cross. Bootstrapped and tested on powerpc64le-linux-gnu with no regressions. Is this okay for trunk? Thanks! Bill 2021-12-13 Bill Schmidt <wschmidt@linux.ibm.com> gcc/ PR target/103622 * config/rs6000/rs6000-c.c (altivec_resolve_new_overloaded_builtin): Skip over instances with undefined function types. --- gcc/config/rs6000/rs6000-c.c | 6 ++++++ 1 file changed, 6 insertions(+)
Comments
Hi! I'd like to ping this patch, now that I'm back from break. Thanks! Bill On 12/13/21 10:15 AM, Bill Schmidt wrote: > Hi! > > For some data types like IEEE-128, we determine whether the type is available > at built-in function initialization time. If it's not, then we don't provide > the function type for function instances that require the data type. PR103622 > observes that this can cause us to ICE when running the list of instances when > the target doesn't support the data type. > > Ideally, we wouldn't even put such an instance in the list of instances that > an overload can map to, but to do that is much more complicated. Instead, > this patch just ensures we don't dereference a NULL pointer when the situation > arises. > > Tested the fix on a powerpc-e300c3-linux-gnu cross. Bootstrapped and tested on > powerpc64le-linux-gnu with no regressions. Is this okay for trunk? > > Thanks! > Bill > > > 2021-12-13 Bill Schmidt <wschmidt@linux.ibm.com> > > gcc/ > PR target/103622 > * config/rs6000/rs6000-c.c (altivec_resolve_new_overloaded_builtin): > Skip over instances with undefined function types. > --- > gcc/config/rs6000/rs6000-c.c | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/gcc/config/rs6000/rs6000-c.c b/gcc/config/rs6000/rs6000-c.c > index 8e83d97e72f..fc4cc929884 100644 > --- a/gcc/config/rs6000/rs6000-c.c > +++ b/gcc/config/rs6000/rs6000-c.c > @@ -2943,6 +2943,12 @@ altivec_resolve_new_overloaded_builtin (location_t loc, tree fndecl, > > for (; instance != NULL; instance = instance->next) > { > + /* It is possible for an instance to require a data type that isn't > + defined on this target, in which case instance->fntype will be > + NULL. */ > + if (!instance->fntype) > + continue; > + > bool mismatch = false; > tree nextparm = TYPE_ARG_TYPES (instance->fntype); >
Happy new year Bill! On Mon, Dec 13, 2021 at 10:15:46AM -0600, Bill Schmidt wrote: > For some data types like IEEE-128, we determine whether the type is available > at built-in function initialization time. If it's not, then we don't provide > the function type for function instances that require the data type. PR103622 > observes that this can cause us to ICE when running the list of instances when > the target doesn't support the data type. > > Ideally, we wouldn't even put such an instance in the list of instances that > an overload can map to, but to do that is much more complicated. Instead, > this patch just ensures we don't dereference a NULL pointer when the situation > arises. Okay for trunk. Thanks! Segher > PR target/103622 > * config/rs6000/rs6000-c.c (altivec_resolve_new_overloaded_builtin): > Skip over instances with undefined function types.
diff --git a/gcc/config/rs6000/rs6000-c.c b/gcc/config/rs6000/rs6000-c.c index 8e83d97e72f..fc4cc929884 100644 --- a/gcc/config/rs6000/rs6000-c.c +++ b/gcc/config/rs6000/rs6000-c.c @@ -2943,6 +2943,12 @@ altivec_resolve_new_overloaded_builtin (location_t loc, tree fndecl, for (; instance != NULL; instance = instance->next) { + /* It is possible for an instance to require a data type that isn't + defined on this target, in which case instance->fntype will be + NULL. */ + if (!instance->fntype) + continue; + bool mismatch = false; tree nextparm = TYPE_ARG_TYPES (instance->fntype);