public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/19430] New: Missing warning
@ 2005-01-13 20:05 terra at gnome dot org
2005-01-13 20:14 ` [Bug c/19430] " dnovillo at gcc dot gnu dot org
` (6 more replies)
0 siblings, 7 replies; 15+ messages in thread
From: terra at gnome dot org @ 2005-01-13 20:05 UTC (permalink / raw)
To: gcc-bugs
the program below should result in a warning that "j" might be used
uninitialized. If the "baz" call is replaced with an explicit assignment
to "j" a warning is generated as expected.
> gcc-3.4.2 -c -Wall -O2 ~/foo.c
(stunning silence)
extern int bar (int);
extern void baz (int *);
int
foo (int i)
{
int j;
if (bar (i)) {
// These should do the same with respect to `j':
baz (&j);
// j = 1;
} else {
}
return j;
}
--
Summary: Missing warning
Product: gcc
Version: 3.4.2
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: terra at gnome dot org
CC: gcc-bugs at gcc dot gnu dot org
GCC target triplet: sparc-sun-solaris2.8, i586-suse-linux
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19430
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug c/19430] Missing warning
2005-01-13 20:05 [Bug c/19430] New: Missing warning terra at gnome dot org
@ 2005-01-13 20:14 ` dnovillo at gcc dot gnu dot org
2005-01-13 20:32 ` [Bug middle-end/19430] Missing uninitialized warning pinskia at gcc dot gnu dot org
` (5 subsequent siblings)
6 siblings, 0 replies; 15+ messages in thread
From: dnovillo at gcc dot gnu dot org @ 2005-01-13 20:14 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From dnovillo at gcc dot gnu dot org 2005-01-13 20:14 -------
Confirmed. It doesn't work on mainline either. The warning machinery is
getting confused with the first V_MAY_DEF to j in the first call to 'bar()'.
It would probably not be too hard to fix for 4.0.
<bb 0>:
# j_7 = V_MAY_DEF <j_3>;
D.1124_2 = bar (i_1);
if (D.1124_2 != 0) goto <L0>; else goto <L1>;
<L0>:;
# j_8 = V_MAY_DEF <j_7>;
baz (&j);
# j_6 = PHI <j_7(0), j_8(1)>;
<L1>:;
# VUSE <j_6>;
D.1125_4 = j;
return D.1125_4;
--
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |dnovillo at gcc dot gnu dot
|dot org |org
Status|UNCONFIRMED |ASSIGNED
Ever Confirmed| |1
Last reconfirmed|0000-00-00 00:00:00 |2005-01-13 20:14:30
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19430
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug middle-end/19430] Missing uninitialized warning
2005-01-13 20:05 [Bug c/19430] New: Missing warning terra at gnome dot org
2005-01-13 20:14 ` [Bug c/19430] " dnovillo at gcc dot gnu dot org
@ 2005-01-13 20:32 ` pinskia at gcc dot gnu dot org
2005-09-10 2:16 ` pinskia at gcc dot gnu dot org
` (4 subsequent siblings)
6 siblings, 0 replies; 15+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-01-13 20:32 UTC (permalink / raw)
To: gcc-bugs
--
What |Removed |Added
----------------------------------------------------------------------------
Severity|normal |minor
Component|c |middle-end
Keywords| |diagnostic
Priority|P2 |P3
Summary|Missing warning |Missing uninitialized
| |warning
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19430
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug middle-end/19430] Missing uninitialized warning
2005-01-13 20:05 [Bug c/19430] New: Missing warning terra at gnome dot org
2005-01-13 20:14 ` [Bug c/19430] " dnovillo at gcc dot gnu dot org
2005-01-13 20:32 ` [Bug middle-end/19430] Missing uninitialized warning pinskia at gcc dot gnu dot org
@ 2005-09-10 2:16 ` pinskia at gcc dot gnu dot org
2005-09-10 2:17 ` pinskia at gcc dot gnu dot org
` (3 subsequent siblings)
6 siblings, 0 replies; 15+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-09-10 2:16 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-09-10 02:16 -------
*** Bug 23805 has been marked as a duplicate of this bug. ***
--
What |Removed |Added
----------------------------------------------------------------------------
CC| |mike at codeweavers dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19430
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug middle-end/19430] Missing uninitialized warning
2005-01-13 20:05 [Bug c/19430] New: Missing warning terra at gnome dot org
` (2 preceding siblings ...)
2005-09-10 2:16 ` pinskia at gcc dot gnu dot org
@ 2005-09-10 2:17 ` pinskia at gcc dot gnu dot org
2005-09-10 2:19 ` pinskia at gcc dot gnu dot org
` (2 subsequent siblings)
6 siblings, 0 replies; 15+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-09-10 2:17 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-09-10 02:17 -------
(In reply to comment #1)
> Confirmed. It doesn't work on mainline either. The warning machinery is
> getting confused with the first V_MAY_DEF to j in the first call to 'bar()'.
Actually the warning machinery does not work with VOPs at all.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19430
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug middle-end/19430] Missing uninitialized warning
2005-01-13 20:05 [Bug c/19430] New: Missing warning terra at gnome dot org
` (3 preceding siblings ...)
2005-09-10 2:17 ` pinskia at gcc dot gnu dot org
@ 2005-09-10 2:19 ` pinskia at gcc dot gnu dot org
2005-09-10 8:07 ` mike at codeweavers dot com
2005-09-12 21:55 ` pinskia at gcc dot gnu dot org
6 siblings, 0 replies; 15+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-09-10 2:19 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-09-10 02:19 -------
(In reply to comment #3)
> (In reply to comment #1)
> > Confirmed. It doesn't work on mainline either. The warning machinery is
> > getting confused with the first V_MAY_DEF to j in the first call to 'bar()'.
> Actually the warning machinery does not work with VOPs at all.
I should say see PR 23805 for an example of that.
Also the extra V_MAY_DEF is coming from that fact the clobber list is not flow sensitive, see PR 23384
for that bug.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19430
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug middle-end/19430] Missing uninitialized warning
2005-01-13 20:05 [Bug c/19430] New: Missing warning terra at gnome dot org
` (4 preceding siblings ...)
2005-09-10 2:19 ` pinskia at gcc dot gnu dot org
@ 2005-09-10 8:07 ` mike at codeweavers dot com
2005-09-12 21:55 ` pinskia at gcc dot gnu dot org
6 siblings, 0 replies; 15+ messages in thread
From: mike at codeweavers dot com @ 2005-09-10 8:07 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From mike at codeweavers dot com 2005-09-10 08:07 -------
Simplifying things a bit:
void foo(int*);
void bar(void) { int x; if(x) foo(&x); }
gcc -c foo.c -Wall -O2 -Wuninitialized
(More stunning silence.)
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19430
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug middle-end/19430] Missing uninitialized warning
2005-01-13 20:05 [Bug c/19430] New: Missing warning terra at gnome dot org
` (5 preceding siblings ...)
2005-09-10 8:07 ` mike at codeweavers dot com
@ 2005-09-12 21:55 ` pinskia at gcc dot gnu dot org
6 siblings, 0 replies; 15+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-09-12 21:55 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-09-12 21:55 -------
*** Bug 23844 has been marked as a duplicate of this bug. ***
--
What |Removed |Added
----------------------------------------------------------------------------
CC| |marcus at jet dot franken
| |dot de
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19430
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug middle-end/19430] Missing uninitialized warning
[not found] <bug-19430-9033@http.gcc.gnu.org/bugzilla/>
` (5 preceding siblings ...)
2007-03-02 23:36 ` skunk at iskunk dot org
@ 2007-03-20 17:43 ` pinskia at gcc dot gnu dot org
6 siblings, 0 replies; 15+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-03-20 17:43 UTC (permalink / raw)
To: gcc-bugs
------- Comment #13 from pinskia at gcc dot gnu dot org 2007-03-20 17:43 -------
*** Bug 31284 has been marked as a duplicate of this bug. ***
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |burnus at gcc dot gnu dot
| |org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19430
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug middle-end/19430] Missing uninitialized warning
[not found] <bug-19430-9033@http.gcc.gnu.org/bugzilla/>
` (4 preceding siblings ...)
2006-09-25 22:44 ` pinskia at gcc dot gnu dot org
@ 2007-03-02 23:36 ` skunk at iskunk dot org
2007-03-20 17:43 ` pinskia at gcc dot gnu dot org
6 siblings, 0 replies; 15+ messages in thread
From: skunk at iskunk dot org @ 2007-03-02 23:36 UTC (permalink / raw)
To: gcc-bugs
------- Comment #12 from skunk at iskunk dot org 2007-03-02 23:36 -------
Here's my minimal test case. Compile with "-O3 -Wall -c":
#include <stdio.h>
void frob(int *pi);
int main(void)
{
int i;
printf("i = %d\n", i);
frob(&i);
return 0;
}
No warning from 4.0.3 nor 4.1.2....
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19430
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug middle-end/19430] Missing uninitialized warning
[not found] <bug-19430-9033@http.gcc.gnu.org/bugzilla/>
` (3 preceding siblings ...)
2006-03-10 15:37 ` mike at codeweavers dot com
@ 2006-09-25 22:44 ` pinskia at gcc dot gnu dot org
2007-03-02 23:36 ` skunk at iskunk dot org
2007-03-20 17:43 ` pinskia at gcc dot gnu dot org
6 siblings, 0 replies; 15+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-09-25 22:44 UTC (permalink / raw)
To: gcc-bugs
------- Comment #11 from pinskia at gcc dot gnu dot org 2006-09-25 22:44 -------
*** Bug 29227 has been marked as a duplicate of this bug. ***
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |debian-gcc at lists dot
| |debian dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19430
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug middle-end/19430] Missing uninitialized warning
[not found] <bug-19430-9033@http.gcc.gnu.org/bugzilla/>
` (2 preceding siblings ...)
2006-03-10 15:31 ` dnovillo at gcc dot gnu dot org
@ 2006-03-10 15:37 ` mike at codeweavers dot com
2006-09-25 22:44 ` pinskia at gcc dot gnu dot org
` (2 subsequent siblings)
6 siblings, 0 replies; 15+ messages in thread
From: mike at codeweavers dot com @ 2006-03-10 15:37 UTC (permalink / raw)
To: gcc-bugs
------- Comment #10 from mike at codeweavers dot com 2006-03-10 15:37 -------
Can I bribe you to work on it by fixing a Wine bug in exchange? :)
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19430
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug middle-end/19430] Missing uninitialized warning
[not found] <bug-19430-9033@http.gcc.gnu.org/bugzilla/>
2006-03-10 15:25 ` ciaccio at disi dot unige dot it
2006-03-10 15:28 ` pinskia at gcc dot gnu dot org
@ 2006-03-10 15:31 ` dnovillo at gcc dot gnu dot org
2006-03-10 15:37 ` mike at codeweavers dot com
` (3 subsequent siblings)
6 siblings, 0 replies; 15+ messages in thread
From: dnovillo at gcc dot gnu dot org @ 2006-03-10 15:31 UTC (permalink / raw)
To: gcc-bugs
------- Comment #9 from dnovillo at gcc dot gnu dot org 2006-03-10 15:31 -------
Not going to work on this problem any time soon.
--
dnovillo at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|dnovillo at gcc dot gnu dot |unassigned at gcc dot gnu
|org |dot org
Status|ASSIGNED |NEW
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19430
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug middle-end/19430] Missing uninitialized warning
[not found] <bug-19430-9033@http.gcc.gnu.org/bugzilla/>
2006-03-10 15:25 ` ciaccio at disi dot unige dot it
@ 2006-03-10 15:28 ` pinskia at gcc dot gnu dot org
2006-03-10 15:31 ` dnovillo at gcc dot gnu dot org
` (4 subsequent siblings)
6 siblings, 0 replies; 15+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-03-10 15:28 UTC (permalink / raw)
To: gcc-bugs
------- Comment #8 from pinskia at gcc dot gnu dot org 2006-03-10 15:28 -------
(In reply to comment #7)
> An even simpler test case of this bug (tested with gcc 3.4.5):
That works correctly in 4.0.0 and above.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19430
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug middle-end/19430] Missing uninitialized warning
[not found] <bug-19430-9033@http.gcc.gnu.org/bugzilla/>
@ 2006-03-10 15:25 ` ciaccio at disi dot unige dot it
2006-03-10 15:28 ` pinskia at gcc dot gnu dot org
` (5 subsequent siblings)
6 siblings, 0 replies; 15+ messages in thread
From: ciaccio at disi dot unige dot it @ 2006-03-10 15:25 UTC (permalink / raw)
To: gcc-bugs
------- Comment #7 from ciaccio at disi dot unige dot it 2006-03-10 15:25 -------
An even simpler test case of this bug (tested with gcc 3.4.5):
int main( void ) {
int rc;
return rc;
*&rc = 0;
}
> gcc -O -Wall program.c
(more stunning silence)
NOTE: in this example, there is no function invocation inside main().
NOTE: remove the last statement in the program, and the warning will show up.
g.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19430
^ permalink raw reply [flat|nested] 15+ messages in thread
end of thread, other threads:[~2007-03-20 17:43 UTC | newest]
Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-01-13 20:05 [Bug c/19430] New: Missing warning terra at gnome dot org
2005-01-13 20:14 ` [Bug c/19430] " dnovillo at gcc dot gnu dot org
2005-01-13 20:32 ` [Bug middle-end/19430] Missing uninitialized warning pinskia at gcc dot gnu dot org
2005-09-10 2:16 ` pinskia at gcc dot gnu dot org
2005-09-10 2:17 ` pinskia at gcc dot gnu dot org
2005-09-10 2:19 ` pinskia at gcc dot gnu dot org
2005-09-10 8:07 ` mike at codeweavers dot com
2005-09-12 21:55 ` pinskia at gcc dot gnu dot org
[not found] <bug-19430-9033@http.gcc.gnu.org/bugzilla/>
2006-03-10 15:25 ` ciaccio at disi dot unige dot it
2006-03-10 15:28 ` pinskia at gcc dot gnu dot org
2006-03-10 15:31 ` dnovillo at gcc dot gnu dot org
2006-03-10 15:37 ` mike at codeweavers dot com
2006-09-25 22:44 ` pinskia at gcc dot gnu dot org
2007-03-02 23:36 ` skunk at iskunk dot org
2007-03-20 17:43 ` pinskia at gcc dot gnu dot 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).