From patchwork Wed Nov 15 13:12:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juergen Christ X-Patchwork-Id: 165344 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b909:0:b0:403:3b70:6f57 with SMTP id t9csp2526805vqg; Wed, 15 Nov 2023 05:13:26 -0800 (PST) X-Google-Smtp-Source: AGHT+IG080oI5D/H4zANmcoyu8mbBfmjxn40ZT1Dhc91CPLrZ0xLs0Sl34pVjyZ3AXhORaKRE6o8 X-Received: by 2002:a05:6214:18e7:b0:66d:178e:36d3 with SMTP id ep7-20020a05621418e700b0066d178e36d3mr5461115qvb.53.1700054005897; Wed, 15 Nov 2023 05:13:25 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1700054005; cv=pass; d=google.com; s=arc-20160816; b=Z+IWtDVZM2eVs/X8jeK/6gJKwZyfZWxPTE5iKTrBFak7C+PGM8AK2BEu6mfoaG83Cb xe5bECJOuz0s9KtugzdaD5w7BKyWZzhznpGsCUHGXwR78jTKG0HtJpzy602K40JdxIlZ A2xYHCctGTjpnQ5L3IGm0fggBowEmZI+Gl1lrJbEiePayU+yKe0vaoxul1xaQiuUFR94 bRaLnl8usB3QsTMDSWZxhMG1bsauCb3Sa3kkBGQkYEuvdDIuFlQLxlWDyOdurGMDmDJx sj2wU2DlnDJlA2gF5iEESdX9El8otBNZkUeHOrxk2f+0VOqq3pdsc1E8PUvThL0oCa/t v7fA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:to:from:dkim-signature :arc-filter:dmarc-filter:delivered-to; bh=B3SNapbY+ixTsAU6TL46vmHATGNg2x2xqYH1ye2Zjj8=; fh=9kNvVTSI6DlgdGzGqx0+PqDVRbZ9BRNCe8aNB0KUSCk=; b=RoIF86/RdDZ7bd3OCFPYJY//7moOx2RMql/1+g0fRb225YwRnZNXefICSUJSKlprQ0 bBQx+hQtCN6s6lDIpI1Pma6ccfC/9MXO6Tie2kOEK4AWm0sYUGU7hKjQyRmYyBx6fVjb gTpoqYK35d2GJc6JxSXhyOm5pzDwyuLhghQjzwwZV8FhYEcB814N0EE4tb65yapa1lVw dKmBpzdsk/7eo409T/Ab7jGriaqpym1UGJgAxJ/0DUHXxcZRsY5hEARkuBA0PTNa+qED JbAgMAJOi6L3DkOr/ECQ8oVdcQmxMC6zhHz59j/V8muDhW9cj0OUil1REZ1Jikn9nT2e A7OA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=cOv9graq; arc=pass (i=1); 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=REJECT sp=NONE dis=NONE) header.from=ibm.com Received: from server2.sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id cx2-20020a056214188200b0066e0c9c71cdsi8923491qvb.297.2023.11.15.05.13.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Nov 2023 05:13:25 -0800 (PST) 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=@ibm.com header.s=pp1 header.b=cOv9graq; arc=pass (i=1); 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=REJECT sp=NONE dis=NONE) header.from=ibm.com Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A6ABF385842D for ; Wed, 15 Nov 2023 13:13:25 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by sourceware.org (Postfix) with ESMTPS id 61DE73858C5E for ; Wed, 15 Nov 2023 13:12:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 61DE73858C5E Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=linux.ibm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linux.ibm.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 61DE73858C5E Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=148.163.158.5 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1700053980; cv=none; b=X490NdNZedrk80EXR7WRLxzJWm+ugRxmslo1iOsRbPGulqbFJhWgedxN4cfnG7KMAGO2YHyKMt//QqSh0KckEVGOig3M9TSmePCXhWyGtzIljG3kFRULOGybp5Qy/FNA7lrg/Ff+/cMDDr68PQMLyFxB+igun3KlyHDs1QoRDwo= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1700053980; c=relaxed/simple; bh=odUoUrvop4Jnv19R3o6qIDmIvzk01CeRbuqVI3FQX3s=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=bT27mEgxCB2mj7xihfu3Da3p7TSIrGgDmFcz4f54Fk++9YMnFYIVZgiJB65H9pmvkm1Ym1M3vhnbrboKWGOwgaacIyjjFFJ6revWsCoVD+hV29Aysbd4i7E3E2PUa4cZNFwCdRxs9KOnOlNrrUlsCe09TTtoj3UmMICh9+PK1KI= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from pps.filterd (m0353725.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3AFDAVc7016054 for ; Wed, 15 Nov 2023 13:12:59 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : subject : date : message-id : mime-version : content-transfer-encoding; s=pp1; bh=B3SNapbY+ixTsAU6TL46vmHATGNg2x2xqYH1ye2Zjj8=; b=cOv9graqwnVttSJC9SEW3OPtlW/+M9HlZf98mEseS49pCA7S3ibuEj0Bo6sVShNkjloV /B2P69LMt4pUVyTVFxSMtslFWUmqFWl+tWmXE+X/k8GtCTeRZYXaqnluUvGrz7gzUhZQ X+/3gt1GKCh+k90o+/dTIYTSJ0EB2G3Y7vNIkkybapakby4PSNxOPfD0VOrA2KJd1KoX uYhnjd4hdUec372Uiko93zmvrGyUB2Q9PJeJwk+szIu+YQASeCjoR0zJy6ETNmQ8Fb18 PgAeFJAvG6nqvCCEWAH+OThS2PJ25ZRsYLK14YQHsb2/h+7yy6MG/5j7HYhuPWfVycp0 Zg== Received: from ppma23.wdc07v.mail.ibm.com (5d.69.3da9.ip4.static.sl-reverse.com [169.61.105.93]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3ucxdy0dt0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 15 Nov 2023 13:12:58 +0000 Received: from pps.filterd (ppma23.wdc07v.mail.ibm.com [127.0.0.1]) by ppma23.wdc07v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 3AFCYR00031982 for ; Wed, 15 Nov 2023 13:12:58 GMT Received: from smtprelay07.fra02v.mail.ibm.com ([9.218.2.229]) by ppma23.wdc07v.mail.ibm.com (PPS) with ESMTPS id 3uanekq5hj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 15 Nov 2023 13:12:58 +0000 Received: from smtpav02.fra02v.mail.ibm.com (smtpav02.fra02v.mail.ibm.com [10.20.54.101]) by smtprelay07.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 3AFDCted3932868 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 15 Nov 2023 13:12:55 GMT Received: from smtpav02.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E6E4620043; Wed, 15 Nov 2023 13:12:54 +0000 (GMT) Received: from smtpav02.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id CA63020040; Wed, 15 Nov 2023 13:12:54 +0000 (GMT) Received: from li-3a824ecc-34fe-11b2-a85c-eae455c7d911.ibm.com (unknown [9.152.222.38]) by smtpav02.fra02v.mail.ibm.com (Postfix) with ESMTP; Wed, 15 Nov 2023 13:12:54 +0000 (GMT) From: Juergen Christ To: krebbel@linux.ibm.com, gcc-patches@gcc.gnu.org Subject: [PATCH] s390: Fix ICE in testcase pr89233 Date: Wed, 15 Nov 2023 14:12:52 +0100 Message-Id: <20231115131252.25924-1-jchrist@linux.ibm.com> X-Mailer: git-send-email 2.39.3 MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: 8BdtbfWd17f5tgS1EpZSuXxW-d6SW8TY X-Proofpoint-ORIG-GUID: 8BdtbfWd17f5tgS1EpZSuXxW-d6SW8TY X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.987,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-11-15_11,2023-11-15_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 phishscore=0 mlxscore=0 adultscore=0 suspectscore=0 priorityscore=1501 impostorscore=0 lowpriorityscore=0 bulkscore=0 mlxlogscore=999 malwarescore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311060000 definitions=main-2311150101 X-Spam-Status: No, score=-12.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, GIT_PATCH_0, KAM_NUMSUBJECT, KAM_SHORT, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE 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.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782635829426078204 X-GMAIL-MSGID: 1782635829426078204 When using GNU vector extensions, an access outside of the vector size caused an ICE on s390. Fix this by aligning with the vec_extract builtin, i.e., computing constant index modulo number of lanes. Fixes testcase gcc.target/s390/pr89233.c. Bootstrapped and tested on s390. OK for mainline? gcc/ChangeLog: * config/s390/vector.md: (*vec_extract) Fix. Signed-off-by: Juergen Christ --- gcc/config/s390/vector.md | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/gcc/config/s390/vector.md b/gcc/config/s390/vector.md index 7d1eb36e8446..deda5990a035 100644 --- a/gcc/config/s390/vector.md +++ b/gcc/config/s390/vector.md @@ -532,12 +532,14 @@ (match_operand:V 1 "nonmemory_operand" "v,v") (parallel [(match_operand:SI 2 "nonmemory_operand" "an,I")])))] - "TARGET_VX - && (!CONST_INT_P (operands[2]) - || UINTVAL (operands[2]) < GET_MODE_NUNITS (mode))" - "@ - vlgv\t%0,%v1,%Y2 - vste\t%v1,%0,%2" + "TARGET_VX" + { + if (CONST_INT_P (operands[2])) + operands[2] = GEN_INT (UINTVAL (operands[2]) & (GET_MODE_NUNITS (mode) - 1)); + if (which_alternative == 0) + return "vlgv\t%0,%v1,%Y2"; + return "vste\t%v1,%0,%2"; + } [(set_attr "op_type" "VRS,VRX")]) ; vlgvb, vlgvh, vlgvf, vlgvg