From patchwork Wed Nov 16 07:29:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Kewen.Lin" X-Patchwork-Id: 20747 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a40e:b0:83:7221:86ba with SMTP id ck14csp253163dyb; Tue, 15 Nov 2022 23:30:14 -0800 (PST) X-Google-Smtp-Source: AA0mqf50WB5u3tZllP8UbOdm3wvyfLItXDEe0HxE5kybMmckqu6yGYz27e/5CiWcAIboMi+EeVWs X-Received: by 2002:a17:906:950d:b0:78d:9b4f:44ee with SMTP id u13-20020a170906950d00b0078d9b4f44eemr16486669ejx.679.1668583814815; Tue, 15 Nov 2022 23:30:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668583814; cv=none; d=google.com; s=arc-20160816; b=DuN6vOLMxFpm+PoWFe2aNYDX0SrwZvgf9mBd46k53qKyr7XJ95cRBLx4Am2XphjXLI ZIdLHYgANaV1WKdi3p0ELx4cZuXpNwXDRX/lXGwx+j1IhpEd1H/j3pE+qc6MnMXrJKdC ngl77dY4lfdFkYAtyWj3v55RZDAXnzWF+X1EJJR3bID1Vm050JWoqli5K07+WkZRjIQv 3x/MXye81f1/aAhZEKNtEVt4J9i5tEOgEN/4o+s7OoF3kVfWXra6+b+mvSXXBark/d1F SmQ3bBZASsD3wiGVhWEuOfUlvDYA2c9UHUVELHD+cX6RDdqFnNb1WuWFYcprf4s41z+Z zqsg== 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=+Z0oEMdq8t4u7PRjnZy1hE9RGdABvuGRcN7DJBySxec=; b=PhB1Gx2hwQ2okrboNIs82YBADLOSwfeF6ZX0uPcIPqn1QUIFnAxtPaAxpTdqjU3olZ dsCSbnwKXcj1KZmx+78fe+8VbBtrgJain2JjKAd0NUIVr8yxmKi4cNRGNjA2anFd302d j4ZoDTmIpRyLddv3jmDpV7Q1rAKZWNBVa4XXZwfgUINT3Aqv+ZNhKCR0fL1mMPZxnUl7 8t9FNjj9pEKauB8s8HPgI8CeOG2XNXKh1AhwhXzzyh8VCvi+UmGy2MbuEfhax6nyCxi3 bPRNGPDy3/cY3e/JJgs/KuJoSjScGMja2Y8GwIMWEgg8q42HodQWtFmx7YpAQ1JqJ9Om TRlQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=MHxrtBj4; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c 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. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id cs7-20020a0564020c4700b0045eec876883si12839088edb.229.2022.11.15.23.30.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Nov 2022 23:30:14 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=MHxrtBj4; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c 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 777223955C81 for ; Wed, 16 Nov 2022 07:30:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 777223955C81 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1668583813; bh=+Z0oEMdq8t4u7PRjnZy1hE9RGdABvuGRcN7DJBySxec=; h=Date:To:Cc:Subject:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=MHxrtBj4mzehAB+0EgnSMUVXFyQMf7cqpOzFXAt8Uyf7C9MeYuNUDQ6WXi1haUwNB 9gHsibkfeKvmnQDYuobRLqAc9snjfxh8PnrIEn8wcV4hRGiW7OZDEm2oIMW3LNUpLx STiRSXiwWAC2WnpyQ5ZkKY1wevHLX1vVRRGuGeqE= 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 0CFCD3955623 for ; Wed, 16 Nov 2022 07:29:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 0CFCD3955623 Received: from pps.filterd (m0098421.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2AG7I98V025209 for ; Wed, 16 Nov 2022 07:29:29 GMT Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3kvubk86xh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 16 Nov 2022 07:29:29 +0000 Received: from m0098421.ppops.net (m0098421.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 2AG7IK5L025507 for ; Wed, 16 Nov 2022 07:29:29 GMT Received: from ppma03ams.nl.ibm.com (62.31.33a9.ip4.static.sl-reverse.com [169.51.49.98]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3kvubk86x2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 16 Nov 2022 07:29:29 +0000 Received: from pps.filterd (ppma03ams.nl.ibm.com [127.0.0.1]) by ppma03ams.nl.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 2AG7Khc4029111; Wed, 16 Nov 2022 07:29:27 GMT Received: from b06avi18878370.portsmouth.uk.ibm.com (b06avi18878370.portsmouth.uk.ibm.com [9.149.26.194]) by ppma03ams.nl.ibm.com with ESMTP id 3kt348wgxg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 16 Nov 2022 07:29:27 +0000 Received: from d06av22.portsmouth.uk.ibm.com (d06av22.portsmouth.uk.ibm.com [9.149.105.58]) by b06avi18878370.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 2AG7U3Td51904866 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 16 Nov 2022 07:30:03 GMT Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id BED474C04A; Wed, 16 Nov 2022 07:29:23 +0000 (GMT) Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7BBBF4C044; Wed, 16 Nov 2022 07:29:22 +0000 (GMT) Received: from [9.197.233.36] (unknown [9.197.233.36]) by d06av22.portsmouth.uk.ibm.com (Postfix) with ESMTP; Wed, 16 Nov 2022 07:29:22 +0000 (GMT) Message-ID: Date: Wed, 16 Nov 2022 15:29:20 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.6.1 Content-Language: en-US To: GCC Patches Cc: Richard Biener , Robin Dapp Subject: [PATCH] Fix typo in gimple_fold_partial_load_store_mem_ref X-TM-AS-GCONF: 00 X-Proofpoint-GUID: pJN3GUeC-Cd8nCqfnsI5TgxYAlruESJQ X-Proofpoint-ORIG-GUID: 1ZA36Oj_Xe1MpXXSNoXc6UOJVakOevPs X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-11-15_08,2022-11-15_03,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 bulkscore=0 lowpriorityscore=0 mlxlogscore=999 malwarescore=0 suspectscore=0 mlxscore=0 priorityscore=1501 spamscore=0 clxscore=1015 adultscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2210170000 definitions=main-2211160050 X-Spam-Status: No, score=-11.5 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.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: "Kewen.Lin via Gcc-patches" From: "Kewen.Lin" Reply-To: "Kewen.Lin" 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?1749636942185321240?= X-GMAIL-MSGID: =?utf-8?q?1749636942185321240?= Hi, As Robin spotted, my recent commit r13-3716 caused an ICE on s390 if vector access with length is enabled there (his patch for the enablement hasn't been committed yet). The failure is caused by one stupid typo, the bias on s390 is -1, so the assertion should use tree_fits_shwi_p rather than tree_fits_uhwi_p. Thanks for Robin's catching. I just reproduced the ICE and verified the fix worked fine with a cross build, the optimized dump against the test case gcc.target/powerpc/pr107412.c looked expected. Is it ok for trunk? BR, Kewen ----- gcc/ChangeLog: * gimple-fold.cc (gimple_fold_partial_load_store_mem_ref): Use tree_fits_shwi_p rather than tree_fits_uhwi_p as bias is signed. --- gcc/gimple-fold.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.25.1 diff --git a/gcc/gimple-fold.cc b/gcc/gimple-fold.cc index 0a212e6d0d4..f8a1875ea3e 100644 --- a/gcc/gimple-fold.cc +++ b/gcc/gimple-fold.cc @@ -5392,7 +5392,7 @@ gimple_fold_partial_load_store_mem_ref (gcall *call, tree vectype, bool mask_p) return NULL_TREE; unsigned int nargs = gimple_call_num_args (call); tree bias = gimple_call_arg (call, nargs - 1); - gcc_assert (tree_fits_uhwi_p (bias)); + gcc_assert (tree_fits_shwi_p (bias)); tree biased_len = int_const_binop (MINUS_EXPR, basic_len, bias); unsigned int len = tree_to_uhwi (biased_len); unsigned int vect_len