public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/46015] New: -Wunused-but-set-variable false positive
@ 2010-10-14 12:01 foldy at rmki dot kfki.hu
  2010-10-14 13:45 ` [Bug c/46015] [4.6 Regression] " rguenth at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: foldy at rmki dot kfki.hu @ 2010-10-14 12:01 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46015

           Summary: -Wunused-but-set-variable false positive
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: foldy@rmki.kfki.hu


/* test.c */

int f(int i)
{
  static void* labs[2] =
    { &&lab1,
      &&lab2
    };

  goto *(labs[i&1]);

 lab1: return 1;
 lab2: return 2;

  return 0;
}

/* test.c end */

GCC 4.6.0 20101014 -Wall prints the followiung warning:

test.c: In function 'f':
test.c:5:16: warning: variable 'labs' set but not used
[-Wunused-but-set-variable]

(GCC 4.5.1 is OK.)


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

* [Bug c/46015] [4.6 Regression] -Wunused-but-set-variable false positive
  2010-10-14 12:01 [Bug c/46015] New: -Wunused-but-set-variable false positive foldy at rmki dot kfki.hu
@ 2010-10-14 13:45 ` rguenth at gcc dot gnu.org
  2010-10-14 19:30 ` [Bug c/46015] [4.6 Regression] -Wunused-but-set-variable warns for arrays used in gotos jakub at gcc dot gnu.org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: rguenth at gcc dot gnu.org @ 2010-10-14 13:45 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46015

Richard Guenther <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |diagnostic
   Target Milestone|---                         |4.6.0
            Summary|-Wunused-but-set-variable   |[4.6 Regression]
                   |false positive              |-Wunused-but-set-variable
                   |                            |false positive


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

* [Bug c/46015] [4.6 Regression] -Wunused-but-set-variable warns for arrays used in gotos
  2010-10-14 12:01 [Bug c/46015] New: -Wunused-but-set-variable false positive foldy at rmki dot kfki.hu
  2010-10-14 13:45 ` [Bug c/46015] [4.6 Regression] " rguenth at gcc dot gnu.org
@ 2010-10-14 19:30 ` jakub at gcc dot gnu.org
  2010-10-18 15:55 ` jakub at gcc dot gnu.org
  2010-10-18 16:16 ` jakub at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: jakub at gcc dot gnu.org @ 2010-10-14 19:30 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46015

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2010.10.14 19:30:17
                 CC|                            |jakub at gcc dot gnu.org
     Ever Confirmed|0                           |1


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

* [Bug c/46015] [4.6 Regression] -Wunused-but-set-variable warns for arrays used in gotos
  2010-10-14 12:01 [Bug c/46015] New: -Wunused-but-set-variable false positive foldy at rmki dot kfki.hu
  2010-10-14 13:45 ` [Bug c/46015] [4.6 Regression] " rguenth at gcc dot gnu.org
  2010-10-14 19:30 ` [Bug c/46015] [4.6 Regression] -Wunused-but-set-variable warns for arrays used in gotos jakub at gcc dot gnu.org
@ 2010-10-18 15:55 ` jakub at gcc dot gnu.org
  2010-10-18 16:16 ` jakub at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: jakub at gcc dot gnu.org @ 2010-10-18 15:55 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46015

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> 2010-10-18 15:55:31 UTC ---
Author: jakub
Date: Mon Oct 18 15:55:25 2010
New Revision: 165643

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=165643
Log:
    PR c/46015
    * c-parser.c (c_parser_statement_after_labels): Call mark_exp_read
    on computed goto argument.

    * semantics.c (finish_goto_stmt): Call mark_rvalue_use on computed
    goto destination.

    * c-c++-common/Wunused-var-13.c: New test.

Added:
    trunk/gcc/testsuite/c-c++-common/Wunused-var-13.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/c-parser.c
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/semantics.c
    trunk/gcc/testsuite/ChangeLog


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

* [Bug c/46015] [4.6 Regression] -Wunused-but-set-variable warns for arrays used in gotos
  2010-10-14 12:01 [Bug c/46015] New: -Wunused-but-set-variable false positive foldy at rmki dot kfki.hu
                   ` (2 preceding siblings ...)
  2010-10-18 15:55 ` jakub at gcc dot gnu.org
@ 2010-10-18 16:16 ` jakub at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: jakub at gcc dot gnu.org @ 2010-10-18 16:16 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46015

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> 2010-10-18 16:15:55 UTC ---
Fixed.


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

end of thread, other threads:[~2010-10-18 16:16 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-10-14 12:01 [Bug c/46015] New: -Wunused-but-set-variable false positive foldy at rmki dot kfki.hu
2010-10-14 13:45 ` [Bug c/46015] [4.6 Regression] " rguenth at gcc dot gnu.org
2010-10-14 19:30 ` [Bug c/46015] [4.6 Regression] -Wunused-but-set-variable warns for arrays used in gotos jakub at gcc dot gnu.org
2010-10-18 15:55 ` jakub at gcc dot gnu.org
2010-10-18 16:16 ` 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).