From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) by sourceware.org (Postfix) with ESMTPS id 62E613858C31 for ; Mon, 26 Jun 2023 07:53:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 62E613858C31 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id 949341F8A4; Mon, 26 Jun 2023 07:53:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1687765991; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=uYJ8h2c9imd3XpGRm/tm0zYpEZrsyIjEiNiyZNNQ8WE=; b=1c/5S9wvYBgjPr01NOsHoUL6IJT6WSD+MgbtiJx45tnWUiKqfJCzL3GOoES3eVzN3Sk+El 5N8GnC/HZgQzLUT5rTWMFa/41EDEqGC6HUvU9CPI4i+bCUt6EkUdJjlwMcfSX3q6FVLrV6 H/s2+fgeeSOhAGpAwouEQkjdi893K8w= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1687765991; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=uYJ8h2c9imd3XpGRm/tm0zYpEZrsyIjEiNiyZNNQ8WE=; b=KUzSU+x5soQs65WfnHtiKnDC4bjLy/p97i2fqcZazoedSs8VOltG9sTP/8TlyLdHN3DZgd fS/h5TwkcbRY1WCw== Received: from wotan.suse.de (wotan.suse.de [10.160.0.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id 873D62C141; Mon, 26 Jun 2023 07:53:11 +0000 (UTC) Date: Mon, 26 Jun 2023 07:53:11 +0000 (UTC) From: Richard Biener To: Ju-Zhe Zhong cc: gcc-patches@gcc.gnu.org, richard.sandiford@arm.com Subject: Re: [PATCH] SCCVN: Fix repeating variable name "len" In-Reply-To: <20230626023204.1010610-1-juzhe.zhong@rivai.ai> Message-ID: References: <20230626023204.1010610-1-juzhe.zhong@rivai.ai> User-Agent: Alpine 2.22 (LSU 394 2020-01-19) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-10.9 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,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 List-Id: On Mon, 26 Jun 2023, juzhe.zhong@rivai.ai wrote: > From: Ju-Zhe Zhong > > Line 3292: has variable name "len": tree mask = NULL_TREE, len = NULL_TREE, bias = NULL_TREE; > Line 3349: has variable name "len": HOST_WIDE_INT start = 0, len = 0; > > Since they are never used simultaneously, such issue is not recognized for now. > However, I want to add LEN_MASK_{LOAD,STORE} which will need these 2 variables, so fix naming in this path. > > Change HOST_WIDE_INT start = 0, len = 0; into HOST_WIDE_INT start = 0, length = 0; OK. > gcc/ChangeLog: > > * tree-ssa-sccvn.cc (vn_reference_lookup_3): Change name "len" into "length". > > --- > gcc/tree-ssa-sccvn.cc | 14 +++++++------- > 1 file changed, 7 insertions(+), 7 deletions(-) > > diff --git a/gcc/tree-ssa-sccvn.cc b/gcc/tree-ssa-sccvn.cc > index 27c84e78fcf..11061a374a2 100644 > --- a/gcc/tree-ssa-sccvn.cc > +++ b/gcc/tree-ssa-sccvn.cc > @@ -3346,17 +3346,17 @@ vn_reference_lookup_3 (ao_ref *ref, tree vuse, void *data_, > = tree_to_uhwi (TYPE_SIZE (TREE_TYPE (vectype))); > if (mask) > { > - HOST_WIDE_INT start = 0, len = 0; > + HOST_WIDE_INT start = 0, length = 0; > unsigned mask_idx = 0; > do > { > if (integer_zerop (VECTOR_CST_ELT (mask, mask_idx))) > { > - if (len != 0) > + if (length != 0) > { > pd.rhs_off = start; > pd.offset = offset2i + start; > - pd.size = len; > + pd.size = length; > if (ranges_known_overlap_p > (offset, maxsize, pd.offset, pd.size)) > { > @@ -3367,18 +3367,18 @@ vn_reference_lookup_3 (ao_ref *ref, tree vuse, void *data_, > } > } > start = (mask_idx + 1) * elsz; > - len = 0; > + length = 0; > } > else > - len += elsz; > + length += elsz; > mask_idx++; > } > while (known_lt (mask_idx, TYPE_VECTOR_SUBPARTS (vectype))); > - if (len != 0) > + if (length != 0) > { > pd.rhs_off = start; > pd.offset = offset2i + start; > - pd.size = len; > + pd.size = length; > if (ranges_known_overlap_p (offset, maxsize, > pd.offset, pd.size)) > return data->push_partial_def (pd, set, set, > -- Richard Biener SUSE Software Solutions Germany GmbH, Frankenstrasse 146, 90461 Nuernberg, Germany; GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman; HRB 36809 (AG Nuernberg)