Message ID | f1d78b22-e5e9-5104-a3aa-750d8bb6cba2@linux.ibm.com |
---|---|
State | Committed |
Commit | 928bc5b863f126189753e45ef45a40265ae028c5 |
Headers |
Return-Path: <gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org> 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 4F7B73955621 for <patchwork@sourceware.org>; Wed, 16 Nov 2022 07:29:59 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4F7B73955621 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1668583799; bh=+Z0oEMdq8t4u7PRjnZy1hE9RGdABvuGRcN7DJBySxec=; h=Date:To:Cc:Subject:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=mnk3J+jatRWVAIIZ75RCPzKRLiX7MDjbIL+dkiCVONbGJlGu7sDIwoui1JtaOrEWF Bocsf+HfNMkgmFOmdzpFAMDAGN3FSnQeQR/W8n8mIDpqE2OBe5Yuvf3j6ax8IUvsZ2 iPn739A0U/dcgAzxRHxUVCGo8teokKreyhz8URtU= 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 <gcc-patches@gcc.gnu.org>; 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 <gcc-patches@gcc.gnu.org>; 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 <gcc-patches@gcc.gnu.org>; 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 <gcc-patches@gcc.gnu.org>; 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: <f1d78b22-e5e9-5104-a3aa-750d8bb6cba2@linux.ibm.com> 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 <gcc-patches@gcc.gnu.org> Cc: Richard Biener <richard.guenther@gmail.com>, Robin Dapp <rdapp@linux.ibm.com> Subject: [PATCH] Fix typo in gimple_fold_partial_load_store_mem_ref Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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 <gcc-patches.gcc.gnu.org> List-Unsubscribe: <https://gcc.gnu.org/mailman/options/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe> List-Archive: <https://gcc.gnu.org/pipermail/gcc-patches/> List-Post: <mailto:gcc-patches@gcc.gnu.org> List-Help: <mailto:gcc-patches-request@gcc.gnu.org?subject=help> List-Subscribe: <https://gcc.gnu.org/mailman/listinfo/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe> From: "Kewen.Lin via Gcc-patches" <gcc-patches@gcc.gnu.org> Reply-To: "Kewen.Lin" <linkw@linux.ibm.com> Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" <gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org> |
Series |
Fix typo in gimple_fold_partial_load_store_mem_ref
|
|
Commit Message
Kewen.Lin
Nov. 16, 2022, 7:29 a.m. UTC
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
Comments
On Wed, Nov 16, 2022 at 8:29 AM Kewen.Lin <linkw@linux.ibm.com> wrote: > > 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? OK. > 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(-) > > 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 > -- > 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