From patchwork Tue May 10 03:35:39 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Trevor Saunders X-Patchwork-Id: 12170 Received: (qmail 29765 invoked by alias); 10 May 2016 03:35:57 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 29715 invoked by uid 89); 10 May 2016 03:35:57 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.4 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.3.2 spammy=HContent-Transfer-Encoding:8bit X-HELO: paperclip.tbsaunde.org Received: from tbsaunde.org (HELO paperclip.tbsaunde.org) (66.228.47.254) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 10 May 2016 03:35:44 +0000 Received: from tsaunders-iceball.corp.tor1.mozilla.com (CPE00fc8d3ff2d3-CM00fc8d3ff2d0.cpe.net.cable.rogers.com [99.242.1.93]) by paperclip.tbsaunde.org (Postfix) with ESMTPSA id A93B8C112; Tue, 10 May 2016 03:35:42 +0000 (UTC) Date: Mon, 9 May 2016 23:35:39 -0400 From: Trevor Saunders To: Yao Qi Cc: tbsaunde+binutils@tbsaunde.org, gdb-patches@sourceware.org Subject: Re: [PATCH, committed] remove trivialy unused variables Message-ID: <20160510033437.GA9700@tsaunders-iceball.corp.tor1.mozilla.com> References: <1462666464-7737-1-git-send-email-tbsaunde+binutils@tbsaunde.org> <8660und5zq.fsf@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <8660und5zq.fsf@gmail.com> User-Agent: Mutt/1.6.0 (2016-04-01) On Mon, May 09, 2016 at 08:51:05AM +0100, Yao Qi wrote: > tbsaunde+binutils@tbsaunde.org writes: > > > diff --git a/gdb/linespec.c b/gdb/linespec.c > > index 2360cc1..c0c3b3b3 100644 > > --- a/gdb/linespec.c > > +++ b/gdb/linespec.c > > @@ -845,8 +845,6 @@ add_sal_to_sals (struct linespec_state *self, > > canonical = &self->canonical_names[sals->nelts - 1]; > > if (!literal_canonical && sal->symtab) > > { > > - const char *fullname = symtab_to_fullname (sal->symtab); > > - > > > Variable fullname isn't used, but I am not sure we can remove the call > to symtab_to_fullname. At least, symtab_to_fullname sets > sal->symtab->fullname, and we have this some lines below, > > canonical->symtab = sal->symtab; arg yeah, it looks like calling it maybe needed. Applying the below doesn't seem to change any testsuite results so perhaps the linespec code could use better tests. Is the below ok with a ChangeLog? Thanks! Trev > > -- > Yao (齐尧) diff --git a/gdb/iq2000-tdep.c b/gdb/iq2000-tdep.c index 14d2afe..600d70a 100644 --- a/gdb/iq2000-tdep.c +++ b/gdb/iq2000-tdep.c @@ -248,7 +248,6 @@ iq2000_scan_prologue (struct gdbarch *gdbarch, if (tgtreg >= 0 && tgtreg < E_NUM_REGS) cache->saved_regs[tgtreg] = -((signed short) (insn & 0xffff)); - if (tgtreg == E_LR_REGNUM) continue; } diff --git a/gdb/linespec.c b/gdb/linespec.c index 2360cc1..7162163 100644 --- a/gdb/linespec.c +++ b/gdb/linespec.c @@ -845,7 +845,7 @@ add_sal_to_sals (struct linespec_state *self, canonical = &self->canonical_names[sals->nelts - 1]; if (!literal_canonical && sal->symtab) { - const char *fullname = symtab_to_fullname (sal->symtab); + symtab_to_fullname (sal->symtab); /* Note that the filter doesn't have to be a valid linespec input. We only apply the ":LINE" treatment to Ada for