From patchwork Fri Feb 26 01:05:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Bergner X-Patchwork-Id: 1444676 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=xQLbPdNW; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Dms0J4bNjz9sVS for ; Fri, 26 Feb 2021 12:05:36 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id ABB613857036; Fri, 26 Feb 2021 01:05:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org ABB613857036 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1614301533; bh=wcPuRHFjh8u2irCMx1eArmTPdWwEHoKwqwBHw/W/kn0=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=xQLbPdNWIPiwh/7Xqo3sU2CES1ysaoQCZ+dDqLWsZLfJnkwILS9pgQRWbSuOth/hi nx4h4qpOG0NgmdzWKr2KCIBmn+ZIwh8v2ffC+CO8Eopu66CefsXrxd16nGupcN5etB DwWhtROcn0lokhXNyrUJ0IOUlVxV5BsITy4GfghI= 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 7E6D13857814 for ; Fri, 26 Feb 2021 01:05:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 7E6D13857814 Received: from pps.filterd (m0098396.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 11Q14El4117940; Thu, 25 Feb 2021 20:05:30 -0500 Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 36xe10gk6u-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 25 Feb 2021 20:05:30 -0500 Received: from m0098396.ppops.net (m0098396.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 11Q15F8k120172; Thu, 25 Feb 2021 20:05:29 -0500 Received: from ppma03wdc.us.ibm.com (ba.79.3fa9.ip4.static.sl-reverse.com [169.63.121.186]) by mx0a-001b2d01.pphosted.com with ESMTP id 36xe10gk62-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 25 Feb 2021 20:05:29 -0500 Received: from pps.filterd (ppma03wdc.us.ibm.com [127.0.0.1]) by ppma03wdc.us.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 11Q1279b031157; Fri, 26 Feb 2021 01:05:28 GMT Received: from b03cxnp07027.gho.boulder.ibm.com (b03cxnp07027.gho.boulder.ibm.com [9.17.130.14]) by ppma03wdc.us.ibm.com with ESMTP id 36tt29jw7f-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 26 Feb 2021 01:05:28 +0000 Received: from b03ledav002.gho.boulder.ibm.com (b03ledav002.gho.boulder.ibm.com [9.17.130.233]) by b03cxnp07027.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 11Q15R6K27787574 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 26 Feb 2021 01:05:27 GMT Received: from b03ledav002.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9E620136051; Fri, 26 Feb 2021 01:05:27 +0000 (GMT) Received: from b03ledav002.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 01E6413604F; Fri, 26 Feb 2021 01:05:26 +0000 (GMT) Received: from [9.160.107.63] (unknown [9.160.107.63]) by b03ledav002.gho.boulder.ibm.com (Postfix) with ESMTP; Fri, 26 Feb 2021 01:05:26 +0000 (GMT) To: Segher Boessenkool , David Edelsohn Subject: rs6000: Fix ICE in rs6000_init_builtins when compiling with -mcpu=440 [PR99279] Message-ID: <6374e0bb-f7ce-45e9-9fc2-48438fb97664@linux.ibm.com> Date: Thu, 25 Feb 2021 19:05:26 -0600 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.8.0 MIME-Version: 1.0 Content-Language: en-US X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.369, 18.0.761 definitions=2021-02-25_15:2021-02-24, 2021-02-25 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 clxscore=1015 mlxscore=0 impostorscore=0 malwarescore=0 priorityscore=1501 suspectscore=0 adultscore=0 bulkscore=0 mlxlogscore=999 phishscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2102260004 X-Spam-Status: No, score=-10.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Peter Bergner via Gcc-patches From: Peter Bergner Reply-To: Peter Bergner Cc: GCC Patches Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" The initialization of compat builtins assumes the builtin we are creating a compatible builtin for exists and ICEs if it doesn't. However, there are valid reasons why some builtins are disabled for a particular compile. In this case, the MMA builtins are disabled for -mcpu=440 (and other cpus), so instead of ICEing, we should just skip adding the MMA compat builtin. This passed bootstrap and regtesting on powerpc64-linux, with running the testsuite in both 32-bit and 64-bit modes, with no regressions. Ok for mainline? The compat builtin patch was approved for backporting to GCC10, so we'll need this fix to go along with it. Peter 2021-02-25 Peter Bergner gcc/ PR target/99279 * config/rs6000/rs6000-call.c (rs6000_init_builtins): Replace assert with an "if" test. diff --git a/gcc/config/rs6000/rs6000-call.c b/gcc/config/rs6000/rs6000-call.c index d2bd03e..f567625 100644 --- a/gcc/config/rs6000/rs6000-call.c +++ b/gcc/config/rs6000/rs6000-call.c @@ -13468,9 +13468,9 @@ rs6000_init_builtins (void) for (i = 0; i < ARRAY_SIZE (bdesc_compat); i++, d++) { tree decl = rs6000_builtin_decls[(int)d->code]; - gcc_assert (decl != NULL); - add_builtin_function (d->name, TREE_TYPE (decl), (int)d->code, - BUILT_IN_MD, NULL, NULL_TREE); + if (decl != NULL) + add_builtin_function (d->name, TREE_TYPE (decl), (int)d->code, + BUILT_IN_MD, NULL, NULL_TREE); } }