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; 8+ 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] 8+ 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; 8+ 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] 8+ 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; 8+ 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] 8+ 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; 8+ 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] 8+ 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; 8+ 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] 8+ 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; 8+ 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] 8+ 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; 8+ 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] 8+ 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; 8+ 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] 8+ messages in thread
end of thread, other threads:[~2005-09-12 21:55 UTC | newest]
Thread overview: 8+ 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
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).