Message ID | 68bebda0-481b-e609-620e-985e8ac89e59@linux.vnet.ibm.com |
---|---|
State | Accepted |
Headers |
Return-Path: <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp29585vqr; Tue, 6 Jun 2023 22:44:52 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6O3HWmdBuyjwG6r69PdAuC2YKy9MXoAEInycXbbasTzZqzF85ZpSWznaBE9DvOhji65A9G X-Received: by 2002:a17:907:9495:b0:977:eed1:4510 with SMTP id dm21-20020a170907949500b00977eed14510mr4499447ejc.21.1686116692614; Tue, 06 Jun 2023 22:44:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686116692; cv=none; d=google.com; s=arc-20160816; b=sxdhj/VCAd7OKKV2HQ7YHOXa74TrFgKjBF59JY1vua6Waa7JW10PkRjQBO+iFkZE/I g4PJfgekDqbdkIHdi8X42PgjFDv97go8+m8v+s9A0oq8uoJ5j4/CvyvkwmKD7nTsjBEV aLeOTUN/RsEtoqU0jOrrNqAPmoQEjRiuP20wGIOtIVYmm2Z5zXydSfe11tmeVVwYD1KR z384aF5Wtsu+RDjcVCb4stGKrVJ56t/ly6J7iuWoVaWsR790pQoHXUGfKOiP4rU+kyAJ u5daeYP1L/53SL5bR64ZZ7mZs1qQjMv8DlS2g52y+rU+M1YTgHM3T90kKhE1RyrjbTgR Ctyw== 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:in-reply-to:to:references :content-language:subject:user-agent:mime-version:date:message-id :dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=7J8zr4A4Gw5RWfVh2XDJVvkQ7nRFVsREmZbGtzB32XA=; b=XmO+HQB9M5CwrSeLW7l9RvHogBmHaAksNaWZYQv7jUUfedu/Exd294DgR19EZz8H2q /QPASDZeLT0HbD20T1clI4MOKa/k3kRFaKkW/teb7Q1jDcxVyn8PXd47803eFLZ8DxaQ 26qMvExOy37IjSBQD/rPcsKsTc8zVTF2OJpmWywlhwITfBo28Oe7DeEAiI7uG4/g8Bvk G6HLBcqfYK4Fwk1Rx0ZeW4uH0gpnoBgQiH1yLzxPq5RTom4a32Lf30fVKrpY9Iq23CHS 9Zbcvm5Ks0dKH1Qk1mll0bTiEZOOHOEou00xe8k+53618ph5uNaS7W0AP3t/+CJFeB7/ 6XvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=PHofBgQ0; 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 qb41-20020a1709077ea900b009787b15aa51si863326ejc.713.2023.06.06.22.44.52 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Jun 2023 22:44:52 -0700 (PDT) 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=PHofBgQ0; 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 48CDE3857726 for <ouuuleilei@gmail.com>; Wed, 7 Jun 2023 05:44:51 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 48CDE3857726 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1686116691; bh=7J8zr4A4Gw5RWfVh2XDJVvkQ7nRFVsREmZbGtzB32XA=; h=Date:Subject:References:To:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=PHofBgQ026kNdAFkzGRv1n3/GMAJJSoGovI76PjhuTw2TqPTYrkkbhp406gKXnSf3 KCSkRXA0G6WkqGvCcZE27aNacPpDD4t9SWVvunGpD5x8rwJxbU2sQ99M3gRBa4qeex I5ejS0krVuIpOD26UslxCggHpyZzTaY7bF/C0hPo= 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 75AB03858C54 for <gcc-patches@gcc.gnu.org>; Wed, 7 Jun 2023 05:44:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 75AB03858C54 Received: from pps.filterd (m0356516.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3575RPPi028016; Wed, 7 Jun 2023 05:44:07 GMT Received: from ppma02wdc.us.ibm.com (aa.5b.37a9.ip4.static.sl-reverse.com [169.55.91.170]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3r2knj8p4j-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 07 Jun 2023 05:44:07 +0000 Received: from pps.filterd (ppma02wdc.us.ibm.com [127.0.0.1]) by ppma02wdc.us.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 3573Frfw022067; Wed, 7 Jun 2023 05:44:06 GMT Received: from smtprelay07.dal12v.mail.ibm.com ([9.208.130.99]) by ppma02wdc.us.ibm.com (PPS) with ESMTPS id 3r2a77t71s-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 07 Jun 2023 05:44:06 +0000 Received: from smtpav06.wdc07v.mail.ibm.com (smtpav06.wdc07v.mail.ibm.com [10.39.53.233]) by smtprelay07.dal12v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 3575i53X19792368 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 7 Jun 2023 05:44:05 GMT Received: from smtpav06.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8848358054; Wed, 7 Jun 2023 05:44:05 +0000 (GMT) Received: from smtpav06.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3635F5803F; Wed, 7 Jun 2023 05:44:04 +0000 (GMT) Received: from [9.109.208.172] (unknown [9.109.208.172]) by smtpav06.wdc07v.mail.ibm.com (Postfix) with ESMTP; Wed, 7 Jun 2023 05:44:03 +0000 (GMT) Message-ID: <68bebda0-481b-e609-620e-985e8ac89e59@linux.vnet.ibm.com> Date: Wed, 7 Jun 2023 11:14:02 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: [PATCH] rs6000: Remove redundant initialization [PR106907] Content-Language: en-US References: <f7c412d0-57d2-1c75-3c8c-c466adb7795e@linux.vnet.ibm.com> To: Segher Boessenkool <segher@kernel.crashing.org>, gcc-patches@gcc.gnu.org, Peter Bergner <bergner@linux.ibm.com> In-Reply-To: <f7c412d0-57d2-1c75-3c8c-c466adb7795e@linux.vnet.ibm.com> X-Forwarded-Message-Id: <f7c412d0-57d2-1c75-3c8c-c466adb7795e@linux.vnet.ibm.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-GUID: bwfugpzsOk8uHV34aBFoPMzADIMt87Lg X-Proofpoint-ORIG-GUID: bwfugpzsOk8uHV34aBFoPMzADIMt87Lg X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.176.26 definitions=2023-06-07_02,2023-06-06_02,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 mlxscore=0 lowpriorityscore=0 suspectscore=0 adultscore=0 malwarescore=0 priorityscore=1501 bulkscore=0 mlxlogscore=999 clxscore=1015 spamscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2305260000 definitions=main-2306070044 X-Spam-Status: No, score=-12.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, 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.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: P Jeevitha via Gcc-patches <gcc-patches@gcc.gnu.org> Reply-To: P Jeevitha <jeevitha@linux.vnet.ibm.com> Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768021497311569355?= X-GMAIL-MSGID: =?utf-8?q?1768021497311569355?= |
Series |
rs6000: Remove redundant initialization [PR106907]
|
|
Checks
Context | Check | Description |
---|---|---|
snail/gcc-patch-check | success | Github commit url |
Commit Message
jeevitha
June 7, 2023, 5:44 a.m. UTC
PR106907 has few warnings spotted from cppcheck. In that addressing redundant initialization issue. Here the initialized value of 'new_addr' was overwritten before it was read. Updated the source by removing the unnecessary initialization of 'new_addr'. 2023-06-07 Jeevitha Palanisamy <jeevitha@linux.ibm.com> gcc/ PR target/106907 * gcc/config/rs6000/rs6000.cc (rs6000_expand_vector_extract): Remove redundant initialization of new_addr.
Comments
Hi Jeevitha, on 2023/6/7 13:44, P Jeevitha via Gcc-patches wrote: > PR106907 has few warnings spotted from cppcheck. In that addressing > redundant initialization issue. Here the initialized value of 'new_addr' > was overwritten before it was read. Updated the source by removing the > unnecessary initialization of 'new_addr'. This is okay for trunk (no backports needed btw), this fix can even be taken as obvious, thanks! > > 2023-06-07 Jeevitha Palanisamy <jeevitha@linux.ibm.com> > > gcc/ > PR target/106907 One curious question is that this PR106907 seemed not to report this issue, is there another PR reporting this? Or do I miss something? BR, Kewen > * gcc/config/rs6000/rs6000.cc (rs6000_expand_vector_extract): Remove redundant > initialization of new_addr. > > > diff --git a/gcc/config/rs6000/rs6000.cc b/gcc/config/rs6000/rs6000.cc > index 42f49e4a56b..d994e004bd3 100644 > --- a/gcc/config/rs6000/rs6000.cc > +++ b/gcc/config/rs6000/rs6000.cc > @@ -7660,12 +7660,11 @@ rs6000_expand_vector_extract (rtx target, rtx vec, rtx elt) > { > unsigned int ele_size = GET_MODE_SIZE (inner_mode); > rtx num_ele_m1 = GEN_INT (GET_MODE_NUNITS (mode) - 1); > - rtx new_addr = gen_reg_rtx (Pmode); > > elt = gen_rtx_AND (Pmode, elt, num_ele_m1); > if (ele_size > 1) > elt = gen_rtx_MULT (Pmode, elt, GEN_INT (ele_size)); > - new_addr = gen_rtx_PLUS (Pmode, XEXP (mem, 0), elt); > + rtx new_addr = gen_rtx_PLUS (Pmode, XEXP (mem, 0), elt); > new_addr = change_address (mem, inner_mode, new_addr); > emit_move_insn (target, new_addr); > } >
On 6/29/23 4:31 AM, Kewen.Lin via Gcc-patches wrote: > This is okay for trunk (no backports needed btw), this fix can even be > taken as obvious, thanks! > >> >> 2023-06-07 Jeevitha Palanisamy <jeevitha@linux.ibm.com> >> >> gcc/ >> PR target/106907 > > One curious question is that this PR106907 seemed not to report this issue, > is there another PR reporting this? Or do I miss something? I think Jeevitha just ran cppcheck by hand and noticed the "new" warnings and added them to the list of things to fixup. Yeah, it would be nice to add the new warnings to the PR for historical reasons. Peter
on 2023/7/11 07:11, Peter Bergner wrote: > On 6/29/23 4:31 AM, Kewen.Lin via Gcc-patches wrote: >> This is okay for trunk (no backports needed btw), this fix can even be >> taken as obvious, thanks! >> >>> >>> 2023-06-07 Jeevitha Palanisamy <jeevitha@linux.ibm.com> >>> >>> gcc/ >>> PR target/106907 >> >> One curious question is that this PR106907 seemed not to report this issue, >> is there another PR reporting this? Or do I miss something? > > I think Jeevitha just ran cppcheck by hand and noticed the "new" warnings > and added them to the list of things to fixup. Yeah, it would be nice to > add the new warnings to the PR for historical reasons. Thanks for clarifying it. Yeah, I noticed Jeevitha added more comments to that PR. :) BR, Kewen
diff --git a/gcc/config/rs6000/rs6000.cc b/gcc/config/rs6000/rs6000.cc index 42f49e4a56b..d994e004bd3 100644 --- a/gcc/config/rs6000/rs6000.cc +++ b/gcc/config/rs6000/rs6000.cc @@ -7660,12 +7660,11 @@ rs6000_expand_vector_extract (rtx target, rtx vec, rtx elt) { unsigned int ele_size = GET_MODE_SIZE (inner_mode); rtx num_ele_m1 = GEN_INT (GET_MODE_NUNITS (mode) - 1); - rtx new_addr = gen_reg_rtx (Pmode); elt = gen_rtx_AND (Pmode, elt, num_ele_m1); if (ele_size > 1) elt = gen_rtx_MULT (Pmode, elt, GEN_INT (ele_size)); - new_addr = gen_rtx_PLUS (Pmode, XEXP (mem, 0), elt); + rtx new_addr = gen_rtx_PLUS (Pmode, XEXP (mem, 0), elt); new_addr = change_address (mem, inner_mode, new_addr); emit_move_insn (target, new_addr); }