From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by sourceware.org (Postfix) with ESMTPS id 6FD953858D37 for ; Thu, 29 Jun 2023 09:32:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6FD953858D37 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=linux.ibm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linux.ibm.com Received: from pps.filterd (m0353728.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 35T9VqlA020488; Thu, 29 Jun 2023 09:32:03 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=message-id : date : mime-version : subject : to : references : cc : from : in-reply-to : content-type : content-transfer-encoding; s=pp1; bh=44PKvtpYwINN/Pb44sfgNioy/08xlLhlcZAaa3abEYs=; b=CfIQmUS/Pxfyb5vlHJaRAuTxKlC7eMh07quOeslb4HD6zbdcsryjt9yWKwBkW0FfHMRY oaIK2xIavmFo8JtbZsbaau/T+nhgcdz0cHnTSBmtPjq62QP5sCdPkqyjhMYHR8Gjk7RV JNLBST3YIMQeI2RXmjYHCXWmAs6bbSCIDqgp6nkyjpwnuejvrLuB32oLF7wLrgoUqTh2 MfqUOkkPZ0tWKnv7gToft5p4M2E4dcwTVN+32R37BNW/0eLgbB9PnKKSH02aodMS1UGe fEjvvWPxZeKA8LWG0mfRsg/NipBBp1MY9hPoq3H1uOw4TwnrMnQ0b9VjtcvaEoO3LlOm iQ== Received: from ppma04ams.nl.ibm.com (63.31.33a9.ip4.static.sl-reverse.com [169.51.49.99]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3rh7dh806b-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 29 Jun 2023 09:32:02 +0000 Received: from pps.filterd (ppma04ams.nl.ibm.com [127.0.0.1]) by ppma04ams.nl.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 35T4hQB3012699; Thu, 29 Jun 2023 09:32:00 GMT Received: from smtprelay01.fra02v.mail.ibm.com ([9.218.2.227]) by ppma04ams.nl.ibm.com (PPS) with ESMTPS id 3rdr4538u0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 29 Jun 2023 09:32:00 +0000 Received: from smtpav01.fra02v.mail.ibm.com (smtpav01.fra02v.mail.ibm.com [10.20.54.100]) by smtprelay01.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 35T9VwJ320775668 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Jun 2023 09:31:58 GMT Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 1F2CE20043; Thu, 29 Jun 2023 09:31:58 +0000 (GMT) Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7383120040; Thu, 29 Jun 2023 09:31:56 +0000 (GMT) Received: from [9.197.225.127] (unknown [9.197.225.127]) by smtpav01.fra02v.mail.ibm.com (Postfix) with ESMTP; Thu, 29 Jun 2023 09:31:56 +0000 (GMT) Message-ID: Date: Thu, 29 Jun 2023 17:31:54 +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 Subject: Re: [PATCH] rs6000: Remove redundant initialization [PR106907] Content-Language: en-US To: P Jeevitha References: <68bebda0-481b-e609-620e-985e8ac89e59@linux.vnet.ibm.com> Cc: Segher Boessenkool , gcc-patches@gcc.gnu.org, Peter Bergner From: "Kewen.Lin" In-Reply-To: <68bebda0-481b-e609-620e-985e8ac89e59@linux.vnet.ibm.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-GUID: eezRuh7b_2hz89Ke7FuU3bmxBrQdL56h X-Proofpoint-ORIG-GUID: eezRuh7b_2hz89Ke7FuU3bmxBrQdL56h X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-06-29_01,2023-06-27_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 lowpriorityscore=0 phishscore=0 priorityscore=1501 spamscore=0 bulkscore=0 mlxlogscore=999 suspectscore=0 impostorscore=0 mlxscore=0 adultscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2305260000 definitions=main-2306290084 X-Spam-Status: No, score=-11.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,GIT_PATCH_0,NICE_REPLY_A,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,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: 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 > > 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); > } >