public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: P Jeevitha <jeevitha@linux.vnet.ibm.com>
To: Segher Boessenkool <segher@kernel.crashing.org>,
	gcc-patches@gcc.gnu.org, Peter Bergner <bergner@linux.ibm.com>
Subject: [PATCH] rs6000: Remove redundant initialization [PR106907]
Date: Wed, 7 Jun 2023 11:14:02 +0530	[thread overview]
Message-ID: <68bebda0-481b-e609-620e-985e8ac89e59@linux.vnet.ibm.com> (raw)
In-Reply-To: <f7c412d0-57d2-1c75-3c8c-c466adb7795e@linux.vnet.ibm.com>

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.


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);
     }


       reply	other threads:[~2023-06-07  5:44 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <f7c412d0-57d2-1c75-3c8c-c466adb7795e@linux.vnet.ibm.com>
2023-06-07  5:44 ` P Jeevitha [this message]
2023-06-29  9:31   ` Kewen.Lin
2023-07-10 23:11     ` Peter Bergner
2023-07-11  1:44       ` Kewen.Lin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=68bebda0-481b-e609-620e-985e8ac89e59@linux.vnet.ibm.com \
    --to=jeevitha@linux.vnet.ibm.com \
    --cc=bergner@linux.ibm.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=segher@kernel.crashing.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).