[COMMITTED] Fix unused variable warning (was: [PATCH 1/3] STABS: remove -gstabs and -gxcoff functionality)
Message ID | 20220914121921.j46kmn2btdwmj3sc@lug-owl.de |
---|---|
State | New, archived |
Headers |
Return-Path: <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5044:0:0:0:0:0 with SMTP id h4csp2787424wrt; Wed, 14 Sep 2022 05:19:54 -0700 (PDT) X-Google-Smtp-Source: AA6agR6YLWb/E+cgixkZseNX/E/Ue/sLZRPjW8gZ7WAYZ9SPtLy21io+gaYAeK9Bjzztn3WNJKFS X-Received: by 2002:a05:6402:748:b0:44e:b48f:f5ec with SMTP id p8-20020a056402074800b0044eb48ff5ecmr31732931edy.146.1663157994342; Wed, 14 Sep 2022 05:19:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663157994; cv=none; d=google.com; s=arc-20160816; b=rlh0gySZ3DkzIEr4C/7k3FI1yVe1VJTy+Y8h7tGfCG+mgTX6yE6BbcSmIfI2dHRnRM k/sFSlZmD2SxNRPemfWiTc8WAUJByicbORDJDEKIqY6g46SZo/pUaM8kU/rTpONjWVo0 BgShdQe4quBfLtliMEs61aWgkjMjnMKCMjjYPng3boPiFrFKu7WSxKKP3hWkyKlw2qaj HeKMziOASsVt9cMeRAmEryl3Hj81XLG/Y6SgmDqMGIgCdZDf3PiQwybWjf8gbSzynfw4 bPztMvkGTxaV7e3cqdJblM+bqPOG+CWKFHWnLOOobxW+PX+N9uFpD5jHcCVE9vWIpEZB 46zQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:to :from:date:dmarc-filter:delivered-to; bh=UCGl2iPP32CqS7tuE4uGJMo6vMe3/vK+1qpsq/WCmT0=; b=EHPlZ64MhXrkhwnPiMH+t4b1DM/nmqCsrNKf2PBedKaAC1J9/dqDWPD0pfbd/zpaFE PFzNDPn8iFEsh7YoGAzPw1rfW+HTm5QLc1ydJtwmuzvKP9J+sR/rJTS/4verriIuWsJz wLurPwkpC4GtYfTB7dTERhYQdvc6epCe1WkdT6ru6b+zF76EBQ+SD9W7YQTTuwO2tGR1 ufeucDrBxUNI4DOTQjZaKiOINjGAcLOpFUAYO//4NUxiCufHa/Qju7uN3eJ3ic47Z4fV tZom8s02A7y80zQLXbriCeDDtbKpCnv1fpIMBa6VjuQDRfByUgxKsS4CnzrNI6FzF+zv 8vjg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id q18-20020a50cc92000000b0044785ed87d7si11266671edi.404.2022.09.14.05.19.54 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Sep 2022 05:19:54 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 8215038582A4 for <ouuuleilei@gmail.com>; Wed, 14 Sep 2022 12:19:48 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from lug-owl.de (lug-owl.de [IPv6:2a03:4000:10:469::]) by sourceware.org (Postfix) with ESMTPS id 6339638582A1 for <gcc-patches@gcc.gnu.org>; Wed, 14 Sep 2022 12:19:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 6339638582A1 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=lug-owl.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=lug-owl.de Received: by lug-owl.de (Postfix, from userid 1001) id E0D8542039; Wed, 14 Sep 2022 14:19:21 +0200 (CEST) Date: Wed, 14 Sep 2022 14:19:21 +0200 From: Jan-Benedict Glaw <jbglaw@lug-owl.de> To: Martin =?utf-8?b?TGnFoWth?= <mliska@suse.cz> Subject: [COMMITTED] Fix unused variable warning (was: [PATCH 1/3] STABS: remove -gstabs and -gxcoff functionality) Message-ID: <20220914121921.j46kmn2btdwmj3sc@lug-owl.de> References: <10a94ccc-e01b-b98a-0fcb-cd661c10c315@suse.cz> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="3zlptapsmxn4ngb2" Content-Disposition: inline In-Reply-To: <10a94ccc-e01b-b98a-0fcb-cd661c10c315@suse.cz> X-Operating-System: Linux chamaeleon 5.14.0-0.bpo.2-amd64 X-gpg-fingerprint: 250D 3BCF 7127 0D8C A444 A961 1DBD 5E75 8399 E1BB X-gpg-key: wwwkeys.de.pgp.net X-Echelon-Enable: howto poison arsenous mail psychological biological nuclear warfare test the bombastical terror of flooding the spy listeners explosion sex drugs and rock'n'roll X-TKUeV: howto poison arsenous mail psychological biological nuclear warfare test the bombastical terror of flooding the spy listeners explosion sex drugs and rock'n'roll X-message-flag: Please send plain text messages only. Do not send HTML emails. Thank you. User-Agent: NeoMutt/20170113 (1.7.2) X-Spam-Status: No, score=-10.0 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, SPF_HELO_PASS, 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 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> Cc: gcc-patches@gcc.gnu.org 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?1743947557115006920?= X-GMAIL-MSGID: =?utf-8?q?1743947557115006920?= |
Series |
[COMMITTED] Fix unused variable warning (was: [PATCH 1/3] STABS: remove -gstabs and -gxcoff functionality)
|
|
Commit Message
Jan-Benedict Glaw
Sept. 14, 2022, 12:19 p.m. UTC
On Thu, 2022-09-01 12:05:23 +0200, Martin Liška <mliska@suse.cz> wrote: > Patch can bootstrap on x86_64-linux-gnu and survives regression tests. > > I've also built all cross compilers. > > Ready to be installed? > Thanks, > Martin > > gcc/ChangeLog: > > * Makefile.in: Remove -gstabs option support, DBX-related > macros and DBX debugging info support. [...] > * config/mips/mips.cc (mips_output_filename): Likewise. > (mips_option_override): Likewise. [...] > diff --git a/gcc/config/mips/mips.cc b/gcc/config/mips/mips.cc > index e81a245dcf4..47724950c3e 100644 > --- a/gcc/config/mips/mips.cc > +++ b/gcc/config/mips/mips.cc [...] > @@ -20505,24 +20500,13 @@ mips_option_override (void) > > for (i = 0; i < FIRST_PSEUDO_REGISTER; i++) > { > - mips_dbx_regno[i] = IGNORED_DWARF_REGNUM; > if (GP_REG_P (i) || FP_REG_P (i) || ALL_COP_REG_P (i)) > mips_dwarf_regno[i] = i; > else > mips_dwarf_regno[i] = INVALID_REGNUM; > } > > - start = GP_DBX_FIRST - GP_REG_FIRST; > - for (i = GP_REG_FIRST; i <= GP_REG_LAST; i++) > - mips_dbx_regno[i] = i + start; > - > - start = FP_DBX_FIRST - FP_REG_FIRST; > - for (i = FP_REG_FIRST; i <= FP_REG_LAST; i++) > - mips_dbx_regno[i] = i + start; > - > /* Accumulator debug registers use big-endian ordering. */ > - mips_dbx_regno[HI_REGNUM] = MD_DBX_FIRST + 0; > - mips_dbx_regno[LO_REGNUM] = MD_DBX_FIRST + 1; > mips_dwarf_regno[HI_REGNUM] = MD_REG_FIRST + 0; > mips_dwarf_regno[LO_REGNUM] = MD_REG_FIRST + 1; > for (i = DSP_ACC_REG_FIRST; i <= DSP_ACC_REG_LAST; i += 2) This leaves the `start` variable unused, resulting in a new warning. Fixed (committed as obvious) by this: /usr/lib/gcc-snapshot/bin/g++ -fno-PIE -c -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -Werror -fno-common -DHAVE_CONFIG_H -I. -I. -I../../gcc/gcc -I../../gcc/gcc/. -I../../gcc/gcc/../include -I../../gcc/gcc/../libcpp/include -I../../gcc/gcc/../libcody -I../../gcc/gcc/../libdecnumber -I../../gcc/gcc/../libdecnumber/dpd -I../libdecnumber -I../../gcc/gcc/../libbacktrace -o mips.o -MT mips.o -MMD -MP -MF ./.deps/mips.TPo ../../gcc/gcc/config/mips/mips.cc ../../gcc/gcc/config/mips/mips.cc: In function 'void mips_option_override()': ../../gcc/gcc/config/mips/mips.cc:20021:10: error: unused variable 'start' [-Werror=unused-variable] 20021 | int i, start, regno, mode; | ^~~~~ 2022-09-14 Jan-Benedict Glaw <jbglaw@lug-owl.de> gcc/ * config/mips/mips.cc (mips_option_override): Drop unused variable. Committed as obvious. MfG, JBG --
Comments
On 9/14/22 14:19, Jan-Benedict Glaw wrote: > On Thu, 2022-09-01 12:05:23 +0200, Martin Liška <mliska@suse.cz> wrote: >> Patch can bootstrap on x86_64-linux-gnu and survives regression tests. >> >> I've also built all cross compilers. >> >> Ready to be installed? >> Thanks, >> Martin >> >> gcc/ChangeLog: >> >> * Makefile.in: Remove -gstabs option support, DBX-related >> macros and DBX debugging info support. > [...] >> * config/mips/mips.cc (mips_output_filename): Likewise. >> (mips_option_override): Likewise. > [...] >> diff --git a/gcc/config/mips/mips.cc b/gcc/config/mips/mips.cc >> index e81a245dcf4..47724950c3e 100644 >> --- a/gcc/config/mips/mips.cc >> +++ b/gcc/config/mips/mips.cc > [...] >> @@ -20505,24 +20500,13 @@ mips_option_override (void) >> >> for (i = 0; i < FIRST_PSEUDO_REGISTER; i++) >> { >> - mips_dbx_regno[i] = IGNORED_DWARF_REGNUM; >> if (GP_REG_P (i) || FP_REG_P (i) || ALL_COP_REG_P (i)) >> mips_dwarf_regno[i] = i; >> else >> mips_dwarf_regno[i] = INVALID_REGNUM; >> } >> >> - start = GP_DBX_FIRST - GP_REG_FIRST; >> - for (i = GP_REG_FIRST; i <= GP_REG_LAST; i++) >> - mips_dbx_regno[i] = i + start; >> - >> - start = FP_DBX_FIRST - FP_REG_FIRST; >> - for (i = FP_REG_FIRST; i <= FP_REG_LAST; i++) >> - mips_dbx_regno[i] = i + start; >> - >> /* Accumulator debug registers use big-endian ordering. */ >> - mips_dbx_regno[HI_REGNUM] = MD_DBX_FIRST + 0; >> - mips_dbx_regno[LO_REGNUM] = MD_DBX_FIRST + 1; >> mips_dwarf_regno[HI_REGNUM] = MD_REG_FIRST + 0; >> mips_dwarf_regno[LO_REGNUM] = MD_REG_FIRST + 1; >> for (i = DSP_ACC_REG_FIRST; i <= DSP_ACC_REG_LAST; i += 2) > > This leaves the `start` variable unused, resulting in a new warning. > Fixed (committed as obvious) by this: > > /usr/lib/gcc-snapshot/bin/g++ -fno-PIE -c -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -Werror -fno-common -DHAVE_CONFIG_H -I. -I. -I../../gcc/gcc -I../../gcc/gcc/. -I../../gcc/gcc/../include -I../../gcc/gcc/../libcpp/include -I../../gcc/gcc/../libcody -I../../gcc/gcc/../libdecnumber -I../../gcc/gcc/../libdecnumber/dpd -I../libdecnumber -I../../gcc/gcc/../libbacktrace -o mips.o -MT mips.o -MMD -MP -MF ./.deps/mips.TPo ../../gcc/gcc/config/mips/mips.cc > ../../gcc/gcc/config/mips/mips.cc: In function 'void mips_option_override()': > ../../gcc/gcc/config/mips/mips.cc:20021:10: error: unused variable 'start' [-Werror=unused-variable] > 20021 | int i, start, regno, mode; > | ^~~~~ > > 2022-09-14 Jan-Benedict Glaw <jbglaw@lug-owl.de> > > gcc/ > * config/mips/mips.cc (mips_option_override): Drop unused variable. > > diff --git a/gcc/config/mips/mips.cc b/gcc/config/mips/mips.cc > index 47724950c3e..387376b3df8 100644 > --- a/gcc/config/mips/mips.cc > +++ b/gcc/config/mips/mips.cc > @@ -20018,7 +20018,7 @@ mips_set_tune (const struct mips_cpu_info *info) > static void > mips_option_override (void) > { > - int i, start, regno, mode; > + int i, regno, mode; > > if (OPTION_SET_P (mips_isa_option)) > mips_isa_option_info = &mips_cpu_info_table[mips_isa_option]; > > > Committed as obvious. > > MfG, JBG > Thanks for the commit! Cheers, Martin
diff --git a/gcc/config/mips/mips.cc b/gcc/config/mips/mips.cc index 47724950c3e..387376b3df8 100644 --- a/gcc/config/mips/mips.cc +++ b/gcc/config/mips/mips.cc @@ -20018,7 +20018,7 @@ mips_set_tune (const struct mips_cpu_info *info) static void mips_option_override (void) { - int i, start, regno, mode; + int i, regno, mode; if (OPTION_SET_P (mips_isa_option)) mips_isa_option_info = &mips_cpu_info_table[mips_isa_option];