From patchwork Fri Mar 17 22:35:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Bergner X-Patchwork-Id: 71499 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp21295wrt; Fri, 17 Mar 2023 15:36:33 -0700 (PDT) X-Google-Smtp-Source: AK7set9hGwvX1sIlNmIWYtid9NdCHAU+1sn3TXOBrQjMOxg0TI2/a7+chj8ekOe3A3V1fpl49OQ8 X-Received: by 2002:aa7:cb10:0:b0:4fd:14d5:bb4b with SMTP id s16-20020aa7cb10000000b004fd14d5bb4bmr4450164edt.23.1679092593100; Fri, 17 Mar 2023 15:36:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679092593; cv=none; d=google.com; s=arc-20160816; b=TT5OfS3zxTY4Bp0iNVOXLprbB7Ho+9W7RgS3D/6pZt8HaJMimpKDOgFxfoOFOXsyKO FLCg3jDn9lGXKVzGd7B44v2P5XYfa/fBp4ZQ9fMg1EBtw6SSCSdIpUV1fYP23LS7ya4D 6hRwXtAiIBQE7J30qLmiORIxHW6tNQpO6PJKYdDsM73XFj8XiyTYaF98OXzaU5IQny0z 0/r6y7bsT4l1qGwBezfa89VL8LJplhsKtHgPVFQA0epXkb9h0nKljPhdTaOpULeVkjZk KqBNWCNkQm4FnVeyFcfRue1mHIJIaY0mYgixMNWYG3iNL78xJRnVpplD8gSqbpL/+5os yO5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:subject:cc:to:content-language:user-agent :mime-version:date:message-id:dmarc-filter:delivered-to :dkim-signature:dkim-filter; bh=dApS9454sjI5SJ39+z7NERLne18tTVfMs9Gm9I0GwAY=; b=HIMxU2o2j7zzVVnc7UYkfYARuj1RttJLs/HjvTLZ1Yt4lFRvNYrQ86mlWciShTKLAi niq5Bck+PuC6NgtRtG9EMbwG++Z6120TF5Q/iBDLFJQdkPIlpI/sFSLuNW5/ViZVVnfg GiqAuxviMXQGOkCAG1y4iv5YXUSX2uaGKOAk0Ju1sTtlN7Ag1yzIFcelCzaXRUqp/1rh 8VdRJOsXehSsvmDUCtlpLT81JPAMOKvw66Kihtwt9HLp7ah3RADr8aqvfk9bX6bHGOnn 07tXBlIGsg+MJypO9eoW5eSg82WlwajTDY43tXdSCvYLT0Yp+5/2pPtumik0LBXAfUkt 8FeQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=N5R6W9Z+; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id q4-20020aa7da84000000b004af7147d830si3822660eds.195.2023.03.17.15.36.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Mar 2023 15:36:33 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=N5R6W9Z+; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 29373385086B for ; Fri, 17 Mar 2023 22:36:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 29373385086B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1679092592; bh=dApS9454sjI5SJ39+z7NERLne18tTVfMs9Gm9I0GwAY=; h=Date:To:Cc:Subject:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=N5R6W9Z+wmltt0sXvC6PgszRSaoms/LNUaJa/G07MI/u8YlXBpfjG2FscGjKsY3rQ I2QyeCuAfwuk4wT6NFhkrlNDfTcWVmaNECMFog5UdoLC21ucQMhsOv6efrxOD9J8lZ OGd10bAbfiL6IWY4n+jY6KD2o0B4mKOheQlXEz48= 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 3D8153858C50 for ; Fri, 17 Mar 2023 22:35:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3D8153858C50 Received: from pps.filterd (m0098399.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 32HLBuax029039; Fri, 17 Mar 2023 22:35:17 GMT Received: from ppma05wdc.us.ibm.com (1b.90.2fa9.ip4.static.sl-reverse.com [169.47.144.27]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3pcywhhnmt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 17 Mar 2023 22:35:16 +0000 Received: from pps.filterd (ppma05wdc.us.ibm.com [127.0.0.1]) by ppma05wdc.us.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 32HLQ6nl001349; Fri, 17 Mar 2023 22:35:15 GMT Received: from smtprelay05.dal12v.mail.ibm.com ([9.208.130.101]) by ppma05wdc.us.ibm.com (PPS) with ESMTPS id 3pbskbjtp4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 17 Mar 2023 22:35:15 +0000 Received: from smtpav02.dal12v.mail.ibm.com (smtpav02.dal12v.mail.ibm.com [10.241.53.101]) by smtprelay05.dal12v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 32HMZDk33736162 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 17 Mar 2023 22:35:13 GMT Received: from smtpav02.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 674405806D; Fri, 17 Mar 2023 22:35:13 +0000 (GMT) Received: from smtpav02.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0530B58069; Fri, 17 Mar 2023 22:35:13 +0000 (GMT) Received: from [9.211.90.110] (unknown [9.211.90.110]) by smtpav02.dal12v.mail.ibm.com (Postfix) with ESMTP; Fri, 17 Mar 2023 22:35:12 +0000 (GMT) Message-ID: Date: Fri, 17 Mar 2023 17:35:12 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 Content-Language: en-US To: GCC Patches Cc: Segher Boessenkool , "Kewen.Lin" , Chip Kerchner Subject: [PATCH] rs6000: Don't ICE when compiling the __builtin_vec_xst_trunc built-in [PR109178] X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: tbAnJgbILcwL67Y1tdsOIyN9lJ80roJi X-Proofpoint-GUID: tbAnJgbILcwL67Y1tdsOIyN9lJ80roJi X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-03-17_17,2023-03-16_02,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 adultscore=0 impostorscore=0 priorityscore=1501 malwarescore=0 bulkscore=0 mlxlogscore=921 clxscore=1015 spamscore=0 suspectscore=0 mlxscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303150002 definitions=main-2303170160 X-Spam-Status: No, score=-10.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) 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 Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1760656194461563611?= X-GMAIL-MSGID: =?utf-8?q?1760656194461563611?= When we expand the __builtin_vec_xst_trunc built-in, we use the wrong mode for the MEM operand which causes an unrecognizable insn ICE. The solution is to use the correct TMODE mode. Is this ok for trunk and gcc12 assuming my bootstraps and regtests show no regressions? Peter gcc/ PR target/109178 * config/rs6000/rs6000-builtin.cc (stv_expand_builtin): Use tmode. gcc/testsuite/ PR target/109178 * gcc.target/powerpc/pr109178.c: New test. diff --git a/gcc/config/rs6000/rs6000-builtin.cc b/gcc/config/rs6000/rs6000-builtin.cc index 737a5c42bfb..83c28cd8af3 100644 --- a/gcc/config/rs6000/rs6000-builtin.cc +++ b/gcc/config/rs6000/rs6000-builtin.cc @@ -2933,7 +2933,7 @@ stv_expand_builtin (insn_code icode, rtx *op, rtx addr; if (op[1] == const0_rtx) - addr = gen_rtx_MEM (Pmode, op[2]); + addr = gen_rtx_MEM (tmode, op[2]); else { op[1] = copy_to_mode_reg (Pmode, op[1]); diff --git a/gcc/testsuite/gcc.target/powerpc/pr109178.c b/gcc/testsuite/gcc.target/powerpc/pr109178.c new file mode 100644 index 00000000000..0f6e2d6b2eb --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/pr109178.c @@ -0,0 +1,13 @@ +/* PR target/109178 */ +/* { dg-require-effective-target int128 } */ +/* { dg-options "-O2 -mdejagnu-cpu=power10" } */ + +/* Verify we do not ICE on the following. */ + +typedef __attribute__ ((altivec (vector__))) signed __int128 v1ti_t; + +void +foo (signed int *dst, v1ti_t src) +{ + __builtin_vec_xst_trunc(src, 0, dst); +}