From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2063) id B6985396E879; Thu, 17 Nov 2022 05:09:52 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B6985396E879 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1668661792; bh=e0VQ6DGHMreTBEmyPwV0IkZU459+3pJMKkNnVDSaiBE=; h=From:To:Subject:Date:From; b=jkrDqZRDhufNItvuQZ/6d2MR46c5BORSlkvJsXOgSO+TmBDDP9oI81Jl4e9q7fV2b XpFTo87z5JLcwYKl/eqmqu05licPKwfWdg8dQs1fPV6GaLdDcRPEl3viK3fqXM4jd7 AXFgMeoV0SkF0k0mSSSd9mSe+h0M65EMa3PujJlM= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Kewen Lin To: gcc-cvs@gcc.gnu.org Subject: [gcc r13-4120] Fix typo in gimple_fold_partial_load_store_mem_ref X-Act-Checkin: gcc X-Git-Author: Kewen Lin X-Git-Refname: refs/heads/master X-Git-Oldrev: a62d957342e3e9ee9bda812f737279f1166e03ba X-Git-Newrev: 928bc5b863f126189753e45ef45a40265ae028c5 Message-Id: <20221117050952.B6985396E879@sourceware.org> Date: Thu, 17 Nov 2022 05:09:52 +0000 (GMT) List-Id: https://gcc.gnu.org/g:928bc5b863f126189753e45ef45a40265ae028c5 commit r13-4120-g928bc5b863f126189753e45ef45a40265ae028c5 Author: Kewen Lin Date: Wed Nov 16 23:08:23 2022 -0600 Fix typo in gimple_fold_partial_load_store_mem_ref 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. 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. Diff: --- 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