From patchwork Wed Jan 26 15:05:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raoni Fassina Firmino X-Patchwork-Id: 50455 Return-Path: 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 96591386482E for ; Wed, 26 Jan 2022 15:06:37 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 96591386482E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1643209597; bh=5Jj+USQY6vHLZ6igy8ZzZ7I+mwHifYPF/9Q67pGrajA=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=YS6Tz9I0f/54V+UadWfoVMoUjGcQVgiodinru9P5e4RtKpG5lI+cG+OjLIUgEU07n oo1f5p0J5Mu1xsFq7hOEyD1ipoW4xpQmpdKCTqBG2z6xDKkRkw9QX3RJiMMoYoZjiH jJM4tlB/dNW1lYfu6AmC9rvO2IiNp8qNoc/9XOCI= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by sourceware.org (Postfix) with ESMTPS id C43AE385041C for ; Wed, 26 Jan 2022 15:06:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org C43AE385041C Received: from pps.filterd (m0098413.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 20QEfcAE004874; Wed, 26 Jan 2022 15:06:03 GMT Received: from pps.reinject (localhost [127.0.0.1]) by mx0b-001b2d01.pphosted.com with ESMTP id 3du89k0hw4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 26 Jan 2022 15:06:03 +0000 Received: from m0098413.ppops.net (m0098413.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 20QEg55J007163; Wed, 26 Jan 2022 15:06:03 GMT Received: from ppma03wdc.us.ibm.com (ba.79.3fa9.ip4.static.sl-reverse.com [169.63.121.186]) by mx0b-001b2d01.pphosted.com with ESMTP id 3du89k0hvm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 26 Jan 2022 15:06:02 +0000 Received: from pps.filterd (ppma03wdc.us.ibm.com [127.0.0.1]) by ppma03wdc.us.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 20QEvtIR021693; Wed, 26 Jan 2022 15:06:02 GMT Received: from b01cxnp23032.gho.pok.ibm.com (b01cxnp23032.gho.pok.ibm.com [9.57.198.27]) by ppma03wdc.us.ibm.com with ESMTP id 3dr9jauqbb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 26 Jan 2022 15:06:02 +0000 Received: from b01ledav005.gho.pok.ibm.com (b01ledav005.gho.pok.ibm.com [9.57.199.110]) by b01cxnp23032.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 20QF61qc35717454 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 26 Jan 2022 15:06:01 GMT Received: from b01ledav005.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 06071AE062; Wed, 26 Jan 2022 15:06:01 +0000 (GMT) Received: from b01ledav005.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 2C0AEAE06F; Wed, 26 Jan 2022 15:05:58 +0000 (GMT) Received: from workbox (unknown [9.160.175.13]) by b01ledav005.gho.pok.ibm.com (Postfix) with ESMTPS; Wed, 26 Jan 2022 15:05:57 +0000 (GMT) Date: Wed, 26 Jan 2022 12:05:54 -0300 To: gcc-patches@gcc.gnu.org Subject: [PATCH v1] rtl: builtins: Fix builtins feclearexcept and feraiseexcept operand check [PR94193] Message-ID: <20220126150554.ksua3vlbqv6ficsg@workbox> Mail-Followup-To: gcc-patches@gcc.gnu.org, segher@kernel.crashing.org, joseph@codesourcery.com, jakub@redhat.com, rguenther@suse.de, hp@bitrange.com, law@redhat.com, will_schmidt@vnet.ibm.com, jeffreyalaw@gmail.com Content-Disposition: inline X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: ml4l9RsLJJ4H5W9UI7xj1JFb8dHdodXH X-Proofpoint-GUID: cgjxmYlvthkjx9E_itbRlZHMySzSth_Z X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.816,Hydra:6.0.425,FMLib:17.11.62.513 definitions=2022-01-26_04,2022-01-26_01,2021-12-02_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 impostorscore=0 malwarescore=0 lowpriorityscore=0 bulkscore=0 mlxscore=0 suspectscore=0 spamscore=0 adultscore=0 phishscore=0 priorityscore=1501 mlxlogscore=944 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2201110000 definitions=main-2201260089 X-Spam-Status: No, score=-11.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Raoni Fassina Firmino via Gcc-patches From: Raoni Fassina Firmino Reply-To: Raoni Fassina Firmino Cc: jakub@redhat.com, rguenther@suse.de, segher@kernel.crashing.org, law@redhat.com, joseph@codesourcery.com Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" Tested on top of master (e0b8716f53ed6455e9f18931940141692793068d) using --enable-checking=yes,rtl, on the following plataforms with no regression: - powerpc64le-linux-gnu (Power 9) - powerpc64le-linux-gnu (Power 8) - powerpc64-linux-gnu (Power 9, with 32 and 64 bits tests) I did not include a testcase because I could not figure out one that works without --enable-checking=rtl yet. ---- 8< ---- Commit 4343f5e25679 ("rtl: builtins: (not just) rs6000: Add builtins for fegetround, feclearexcept and feraiseexcept [PR94193]") broke gcc bootstra when building with --enable-checking=rtl[1]. The function expand_builtin_feclear_feraise_except was failing to proper validate op0 predicate before emit_insn leading to the mismatch type failure. [1] https://gcc.gnu.org/pipermail/gcc-patches/2022-January/589186.html 2022-01-26 Raoni Fassina Firmino gcc/ PR target/94193 * builtins.cc (expand_builtin_feclear_feraise_except): Add op0 predicate check. Signed-off-by: Raoni Fassina Firmino --- gcc/builtins.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gcc/builtins.cc b/gcc/builtins.cc index e84208035dab..d784a57c2b81 100644 --- a/gcc/builtins.cc +++ b/gcc/builtins.cc @@ -2598,6 +2598,9 @@ expand_builtin_feclear_feraise_except (tree exp, rtx target, if (icode == CODE_FOR_nothing) return NULL_RTX; + if (!(*insn_data[icode].operand[1].predicate) (op0, GET_MODE (op0))) + return NULL_RTX; + if (target == 0 || GET_MODE (target) != target_mode || !(*insn_data[icode].operand[0].predicate) (target, target_mode))