public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/44042]  New: [4.4, 4.5,4.6 Regression] Missing warning for unitialized varaible in switch statement
@ 2010-05-08 14:58 tkoenig at gcc dot gnu dot org
  2010-05-08 14:59 ` [Bug c/44042] " tkoenig at gcc dot gnu dot org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: tkoenig at gcc dot gnu dot org @ 2010-05-08 14:58 UTC (permalink / raw)
  To: gcc-bugs

ig25@linux-fd1f:/tmp> cat haha.c
int f(n)
{
  int r;
  switch(n)
    {
    case 1:
      r = 3;
    }
  return r;
}
ig25@linux-fd1f:/tmp> gcc -O3 -c -Wall haha.c
ig25@linux-fd1f:/tmp> gcc -v
Es werden eingebaute Spezifikationen verwendet.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/home/ig25/libexec/gcc/x86_64-unknown-linux-gnu/4.6.0/lto-wrapper
Ziel: x86_64-unknown-linux-gnu
Konfiguriert mit: ../fortran-dev/configure --prefix=/home/ig25
--enable-languages=all,ada --with-mpc=/usr/local
Thread-Modell: posix
gcc-Version 4.6.0 20100430 (experimental) (GCC)
ig25@linux-fd1f:/tmp> gcc-3.3 -O3 -c -Wall haha.c
haha.c: In function `f':
haha.c:3: warning: `r' might be used uninitialized in this function

Also fails for 4.4 and 4.5.


-- 
           Summary: [4.4, 4.5,4.6 Regression] Missing warning for
                    unitialized varaible in switch statement
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Keywords: diagnostic
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: tkoenig at gcc dot gnu dot org


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


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

* [Bug c/44042] [4.4, 4.5,4.6 Regression] Missing warning for unitialized varaible in switch statement
  2010-05-08 14:58 [Bug c/44042] New: [4.4, 4.5,4.6 Regression] Missing warning for unitialized varaible in switch statement tkoenig at gcc dot gnu dot org
@ 2010-05-08 14:59 ` tkoenig at gcc dot gnu dot org
  2010-05-08 15:00 ` [Bug c/44042] [4.4/4.5/4.6 " tkoenig at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: tkoenig at gcc dot gnu dot org @ 2010-05-08 14:59 UTC (permalink / raw)
  To: gcc-bugs



-- 

tkoenig at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to fail|                            |4.4.1 4.5.0 4.6.0
      Known to work|                            |3.3.3
   Target Milestone|---                         |4.4.6


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


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

* [Bug c/44042] [4.4/4.5/4.6 Regression] Missing warning for unitialized varaible in switch statement
  2010-05-08 14:58 [Bug c/44042] New: [4.4, 4.5,4.6 Regression] Missing warning for unitialized varaible in switch statement tkoenig at gcc dot gnu dot org
  2010-05-08 14:59 ` [Bug c/44042] " tkoenig at gcc dot gnu dot org
@ 2010-05-08 15:00 ` tkoenig at gcc dot gnu dot org
  2010-05-08 15:33 ` [Bug c/44042] [4.1/4.2/4.4/4.5/4.6 " hjl dot tools at gmail dot com
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: tkoenig at gcc dot gnu dot org @ 2010-05-08 15:00 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from tkoenig at gcc dot gnu dot org  2010-05-08 15:00 -------
Adjusting subject to make this show up on the
regression list...


-- 

tkoenig at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[4.4, 4.5,4.6 Regression]   |[4.4/4.5/4.6 Regression]
                   |Missing warning for         |Missing warning for
                   |unitialized varaible in     |unitialized varaible in
                   |switch statement            |switch statement


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


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

* [Bug c/44042] [4.1/4.2/4.4/4.5/4.6 Regression] Missing warning for unitialized varaible in switch statement
  2010-05-08 14:58 [Bug c/44042] New: [4.4, 4.5,4.6 Regression] Missing warning for unitialized varaible in switch statement tkoenig at gcc dot gnu dot org
  2010-05-08 14:59 ` [Bug c/44042] " tkoenig at gcc dot gnu dot org
  2010-05-08 15:00 ` [Bug c/44042] [4.4/4.5/4.6 " tkoenig at gcc dot gnu dot org
@ 2010-05-08 15:33 ` hjl dot tools at gmail dot com
  2010-05-08 16:39 ` rguenth at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: hjl dot tools at gmail dot com @ 2010-05-08 15:33 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from hjl dot tools at gmail dot com  2010-05-08 15:33 -------
It failed with gcc 4.1 and 4.2. I think 4.3 is the same.


-- 

hjl dot tools at gmail dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
      Known to fail|4.4.1 4.5.0 4.6.0           |4.1.2 4.2.4 4.4.1 4.5.0
                   |                            |4.6.0
   Last reconfirmed|0000-00-00 00:00:00         |2010-05-08 15:33:14
               date|                            |
            Summary|[4.4/4.5/4.6 Regression]    |[4.1/4.2/4.4/4.5/4.6
                   |Missing warning for         |Regression] Missing warning
                   |unitialized varaible in     |for unitialized varaible in
                   |switch statement            |switch statement


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


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

* [Bug c/44042] [4.1/4.2/4.4/4.5/4.6 Regression] Missing warning for unitialized varaible in switch statement
  2010-05-08 14:58 [Bug c/44042] New: [4.4, 4.5,4.6 Regression] Missing warning for unitialized varaible in switch statement tkoenig at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2010-05-08 15:33 ` [Bug c/44042] [4.1/4.2/4.4/4.5/4.6 " hjl dot tools at gmail dot com
@ 2010-05-08 16:39 ` rguenth at gcc dot gnu dot org
  2010-05-09 11:12 ` tkoenig at gcc dot gnu dot org
  2010-05-09 11:13 ` rguenther at suse dot de
  5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2010-05-08 16:39 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from rguenth at gcc dot gnu dot org  2010-05-08 16:39 -------
That's the usual CCP exploits undefined behavior bug.  There's a bug ...
somewhere.  WONTFIX.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |WONTFIX


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


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

* [Bug c/44042] [4.1/4.2/4.4/4.5/4.6 Regression] Missing warning for unitialized varaible in switch statement
  2010-05-08 14:58 [Bug c/44042] New: [4.4, 4.5,4.6 Regression] Missing warning for unitialized varaible in switch statement tkoenig at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2010-05-08 16:39 ` rguenth at gcc dot gnu dot org
@ 2010-05-09 11:12 ` tkoenig at gcc dot gnu dot org
  2010-05-09 11:13 ` rguenther at suse dot de
  5 siblings, 0 replies; 7+ messages in thread
From: tkoenig at gcc dot gnu dot org @ 2010-05-09 11:12 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from tkoenig at gcc dot gnu dot org  2010-05-09 11:12 -------
Sorry, I cannot parse "CCP exploits undefined behavior".

Why should there be no warning for this, when this warning
was present in gcc 3.x?


-- 

tkoenig at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rguenth at gcc dot gnu dot
                   |                            |org


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


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

* [Bug c/44042] [4.1/4.2/4.4/4.5/4.6 Regression] Missing warning for unitialized varaible in switch statement
  2010-05-08 14:58 [Bug c/44042] New: [4.4, 4.5,4.6 Regression] Missing warning for unitialized varaible in switch statement tkoenig at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2010-05-09 11:12 ` tkoenig at gcc dot gnu dot org
@ 2010-05-09 11:13 ` rguenther at suse dot de
  5 siblings, 0 replies; 7+ messages in thread
From: rguenther at suse dot de @ 2010-05-09 11:13 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from rguenther at suse dot de  2010-05-09 11:13 -------
Subject: Re:  [4.1/4.2/4.4/4.5/4.6 Regression] Missing warning
 for unitialized varaible in switch statement

On Sun, 9 May 2010, tkoenig at gcc dot gnu dot org wrote:

> ------- Comment #4 from tkoenig at gcc dot gnu dot org  2010-05-09 11:12 -------
> Sorry, I cannot parse "CCP exploits undefined behavior".
> 
> Why should there be no warning for this, when this warning
> was present in gcc 3.x?

because we optimize better now and the code has vanished before
we get a chance to emit the warning


-- 


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


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

end of thread, other threads:[~2010-05-09 11:13 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-05-08 14:58 [Bug c/44042] New: [4.4, 4.5,4.6 Regression] Missing warning for unitialized varaible in switch statement tkoenig at gcc dot gnu dot org
2010-05-08 14:59 ` [Bug c/44042] " tkoenig at gcc dot gnu dot org
2010-05-08 15:00 ` [Bug c/44042] [4.4/4.5/4.6 " tkoenig at gcc dot gnu dot org
2010-05-08 15:33 ` [Bug c/44042] [4.1/4.2/4.4/4.5/4.6 " hjl dot tools at gmail dot com
2010-05-08 16:39 ` rguenth at gcc dot gnu dot org
2010-05-09 11:12 ` tkoenig at gcc dot gnu dot org
2010-05-09 11:13 ` rguenther at suse dot de

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