public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jan-Benedict Glaw <jbglaw@lug-owl.de>
To: "Martin Liška" <mliska@suse.cz>
Cc: gcc-patches@gcc.gnu.org
Subject: [COMMITTED] Fix unused variable warning (was: [PATCH 1/3] STABS: remove -gstabs and -gxcoff functionality)
Date: Wed, 14 Sep 2022 14:19:21 +0200	[thread overview]
Message-ID: <20220914121921.j46kmn2btdwmj3sc@lug-owl.de> (raw)
In-Reply-To: <10a94ccc-e01b-b98a-0fcb-cd661c10c315@suse.cz>

[-- Attachment #1: Type: text/plain, Size: 3313 bytes --]

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

-- 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

  parent reply	other threads:[~2022-09-14 12:19 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-01 10:05 [PATCH 1/3] STABS: remove -gstabs and -gxcoff functionality Martin Liška
2022-09-01 10:05 ` Martin Liška
2022-09-01 11:18 ` Richard Biener
2022-09-02  7:00   ` Martin Liška
2022-09-02  8:54     ` Richard Biener
2022-09-05  7:59       ` Martin Liška
2022-09-05  9:05         ` Richard Biener
2022-09-14 12:19 ` Jan-Benedict Glaw [this message]
2022-09-14 13:20   ` [COMMITTED] Fix unused variable warning (was: [PATCH 1/3] STABS: remove -gstabs and -gxcoff functionality) Martin Liška
2022-10-10 14:19 ` Restore default 'sorry' 'TARGET_ASM_CONSTRUCTOR', 'TARGET_ASM_DESTRUCTOR' " Thomas Schwinge
2022-10-10 14:23   ` Tom de Vries
2022-10-11  6:40     ` Richard Biener
2022-11-04  9:12       ` Better integrate default 'sorry' 'TARGET_ASM_CONSTRUCTOR', 'TARGET_ASM_DESTRUCTOR' (was: Restore default 'sorry' 'TARGET_ASM_CONSTRUCTOR', 'TARGET_ASM_DESTRUCTOR') Thomas Schwinge
2022-10-12  9:21   ` Restore default 'sorry' 'TARGET_ASM_CONSTRUCTOR', 'TARGET_ASM_DESTRUCTOR' (was: [PATCH 1/3] STABS: remove -gstabs and -gxcoff functionality) Martin Liška
2022-11-04  9:04     ` Thomas Schwinge
2022-11-04  9:07       ` Thomas Schwinge
2022-11-04  9:32 ` [PATCH 1/3] STABS: remove -gstabs and -gxcoff functionality Thomas Schwinge
2022-11-10 14:02   ` Martin Liška
2022-11-10 14:12     ` Michael Matz
2022-11-10 14:13       ` Martin Liška

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=20220914121921.j46kmn2btdwmj3sc@lug-owl.de \
    --to=jbglaw@lug-owl.de \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=mliska@suse.cz \
    /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).