public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug other/97305] New: options-save.c:8526:26: error: unused variable 'mask'
@ 2020-10-06 12:30 danglin at gcc dot gnu.org
  2020-10-06 12:46 ` [Bug bootstrap/97305] " jakub at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: danglin at gcc dot gnu.org @ 2020-10-06 12:30 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97305

            Bug ID: 97305
           Summary: options-save.c:8526:26: error: unused variable 'mask'
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: other
          Assignee: unassigned at gcc dot gnu.org
          Reporter: danglin at gcc dot gnu.org
                CC: jakub at gcc dot gnu.org
  Target Milestone: ---
              Host: hppa*-*-*
            Target: hppa*-*-*
             Build: hppa*-*-*

options-save.c: In function 'void cl_target_option_save(cl_target_option*,
gcc_o
ptions*, gcc_options*)':
options-save.c:8526:26: error: unused variable 'mask' [-Werror=unused-variable]
 8526 |   unsigned HOST_WIDE_INT mask = 0;
      |                          ^~~~
options-save.c: In function 'void cl_target_option_restore(gcc_options*,
gcc_opt
ions*, cl_target_option*)':
options-save.c:8537:26: error: unused variable 'mask' [-Werror=unused-variable]
 8537 |   unsigned HOST_WIDE_INT mask;
      |                          ^~~~

/* Save selected option variables into a structure.  */
void
cl_target_option_save (struct cl_target_option *ptr, struct gcc_options *opts,
                       struct gcc_options *opts_set)
{
  if (targetm.target_option.save)
    targetm.target_option.save (ptr, opts, opts_set);

  ptr->x_target_flags = opts->x_target_flags;

  unsigned HOST_WIDE_INT mask = 0;
  ptr->explicit_mask_target_flags = opts_set->x_target_flags;
}

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug bootstrap/97305] options-save.c:8526:26: error: unused variable 'mask'
  2020-10-06 12:30 [Bug other/97305] New: options-save.c:8526:26: error: unused variable 'mask' danglin at gcc dot gnu.org
@ 2020-10-06 12:46 ` jakub at gcc dot gnu.org
  2020-10-07  8:54 ` cvs-commit at gcc dot gnu.org
  2020-10-07  9:34 ` jakub at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: jakub at gcc dot gnu.org @ 2020-10-06 12:46 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97305

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |11.0
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |ASSIGNED
          Component|other                       |bootstrap
   Last reconfirmed|                            |2020-10-06

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug bootstrap/97305] options-save.c:8526:26: error: unused variable 'mask'
  2020-10-06 12:30 [Bug other/97305] New: options-save.c:8526:26: error: unused variable 'mask' danglin at gcc dot gnu.org
  2020-10-06 12:46 ` [Bug bootstrap/97305] " jakub at gcc dot gnu.org
@ 2020-10-07  8:54 ` cvs-commit at gcc dot gnu.org
  2020-10-07  9:34 ` jakub at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-10-07  8:54 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97305

--- Comment #1 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jakub Jelinek <jakub@gcc.gnu.org>:

https://gcc.gnu.org/g:e91c34262d2dd06da4b9436744bff89007dee2c9

commit r11-3692-ge91c34262d2dd06da4b9436744bff89007dee2c9
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Wed Oct 7 10:52:47 2020 +0200

    options: Avoid unused variable mask warning [PR97305]

    > options-save.c: In function 'void
cl_target_option_save(cl_target_option*, gcc_options*, gcc_options*)':
    > options-save.c:8526:26: error: unused variable 'mask'
[-Werror=unused-variable]
    >  8526 |   unsigned HOST_WIDE_INT mask = 0;
    >       |                          ^~~~
    > options-save.c: In function 'void cl_target_option_restore(gcc_options*,
gcc_options*, cl_target_option*)':
    > options-save.c:8537:26: error: unused variable 'mask'
[-Werror=unused-variable]
    >  8537 |   unsigned HOST_WIDE_INT mask;
    >       |                          ^~~~

    Oops, missed that, sorry.

    The following patch should fix that, tested on x86_64-linux make
    options-save.c (same file as before) and -> ia64-linux cross make
    options-save.o (no warning anymore, just the unwanted declarations gone).

    2020-10-07  Jakub Jelinek  <jakub@redhat.com>

            PR bootstrap/97305
            * optc-save-gen.awk: Don't declare mask variable if explicit_mask
            array is not present.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug bootstrap/97305] options-save.c:8526:26: error: unused variable 'mask'
  2020-10-06 12:30 [Bug other/97305] New: options-save.c:8526:26: error: unused variable 'mask' danglin at gcc dot gnu.org
  2020-10-06 12:46 ` [Bug bootstrap/97305] " jakub at gcc dot gnu.org
  2020-10-07  8:54 ` cvs-commit at gcc dot gnu.org
@ 2020-10-07  9:34 ` jakub at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: jakub at gcc dot gnu.org @ 2020-10-07  9:34 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97305

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Should be fixed now.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-10-07  9:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-06 12:30 [Bug other/97305] New: options-save.c:8526:26: error: unused variable 'mask' danglin at gcc dot gnu.org
2020-10-06 12:46 ` [Bug bootstrap/97305] " jakub at gcc dot gnu.org
2020-10-07  8:54 ` cvs-commit at gcc dot gnu.org
2020-10-07  9:34 ` jakub at gcc dot gnu.org

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).