public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
* [Bug middle-end/24129] New: [4.0 4.1 regression] bogus warning <var> is used uninitialized in this function @ 2005-09-29 20:23 doko at debian dot org 2005-09-29 20:24 ` [Bug middle-end/24129] " doko at debian dot org ` (4 more replies) 0 siblings, 5 replies; 6+ messages in thread From: doko at debian dot org @ 2005-09-29 20:23 UTC (permalink / raw) To: gcc-bugs $ gcc -O3 -c -Wall -fno-strict-aliasing marshal.i ../Python/marshal.c: In function 'PyMarshal_ReadShortFromFile': ../Python/marshal.c:342: warning: 'rf.end' is used uninitialized in this function ../Python/marshal.c:342: warning: 'rf.ptr' is used uninitialized in this function The warning is not shown with 3.4 CVS, seen with 4.0.2 and CVS HEAD 20050922, using -fno-inline-functions avoids the warning. -- Summary: [4.0 4.1 regression] bogus warning <var> is used uninitialized in this function Product: gcc Version: 4.0.2 Status: UNCONFIRMED Severity: normal Priority: P2 Component: middle-end AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: doko at debian dot org CC: gcc-bugs at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24129 ^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug middle-end/24129] [4.0 4.1 regression] bogus warning <var> is used uninitialized in this function 2005-09-29 20:23 [Bug middle-end/24129] New: [4.0 4.1 regression] bogus warning <var> is used uninitialized in this function doko at debian dot org @ 2005-09-29 20:24 ` doko at debian dot org 2005-09-29 20:26 ` pinskia at gcc dot gnu dot org ` (3 subsequent siblings) 4 siblings, 0 replies; 6+ messages in thread From: doko at debian dot org @ 2005-09-29 20:24 UTC (permalink / raw) To: gcc-bugs ------- Additional Comments From doko at debian dot org 2005-09-29 20:24 ------- Created an attachment (id=9841) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=9841&action=view) preprocessed source -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24129 ^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug middle-end/24129] [4.0 4.1 regression] bogus warning <var> is used uninitialized in this function 2005-09-29 20:23 [Bug middle-end/24129] New: [4.0 4.1 regression] bogus warning <var> is used uninitialized in this function doko at debian dot org 2005-09-29 20:24 ` [Bug middle-end/24129] " doko at debian dot org @ 2005-09-29 20:26 ` pinskia at gcc dot gnu dot org 2005-09-29 20:35 ` pinskia at gcc dot gnu dot org ` (2 subsequent siblings) 4 siblings, 0 replies; 6+ messages in thread From: pinskia at gcc dot gnu dot org @ 2005-09-29 20:26 UTC (permalink / raw) To: gcc-bugs ------- Additional Comments From pinskia at gcc dot gnu dot org 2005-09-29 20:26 ------- I really doubt this is bogus but I have not looked into the source yet. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24129 ^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug middle-end/24129] [4.0 4.1 regression] bogus warning <var> is used uninitialized in this function 2005-09-29 20:23 [Bug middle-end/24129] New: [4.0 4.1 regression] bogus warning <var> is used uninitialized in this function doko at debian dot org 2005-09-29 20:24 ` [Bug middle-end/24129] " doko at debian dot org 2005-09-29 20:26 ` pinskia at gcc dot gnu dot org @ 2005-09-29 20:35 ` pinskia at gcc dot gnu dot org 2005-09-29 20:40 ` doko at debian dot org 2005-09-29 20:44 ` pinskia at gcc dot gnu dot org 4 siblings, 0 replies; 6+ messages in thread From: pinskia at gcc dot gnu dot org @ 2005-09-29 20:35 UTC (permalink / raw) To: gcc-bugs ------- Additional Comments From pinskia at gcc dot gnu dot org 2005-09-29 20:35 ------- Lets look at the two functions: static int r_short(RFILE *p) { register short x; x = ((p)->fp ? _IO_getc ((p)->fp) : (((p)->ptr != (p)->end) ? (unsigned char)*(p)->ptr++ : (-1))); x |= ((p)->fp ? _IO_getc ((p)->fp) : (((p)->ptr != (p)->end) ? (unsigned char)*(p)->ptr++ : (-1))) << 8; x |= -(x & 0x8000); return x; } int PyMarshal_ReadShortFromFile(FILE *fp) { WFILE rf; rf.fp = fp; rf.strings = ((void *)0); return r_short(&rf); } It is obvious that the warnings are valid as rf.end and rf.ptr is not initialized in PyMarshal_ReadShortFromFile. There are no way to know that the arguments passing to PyMarshal_ReadShortFromFile are non null from the source you gave so the warning is correct. -- What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution| |INVALID http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24129 ^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug middle-end/24129] [4.0 4.1 regression] bogus warning <var> is used uninitialized in this function 2005-09-29 20:23 [Bug middle-end/24129] New: [4.0 4.1 regression] bogus warning <var> is used uninitialized in this function doko at debian dot org ` (2 preceding siblings ...) 2005-09-29 20:35 ` pinskia at gcc dot gnu dot org @ 2005-09-29 20:40 ` doko at debian dot org 2005-09-29 20:44 ` pinskia at gcc dot gnu dot org 4 siblings, 0 replies; 6+ messages in thread From: doko at debian dot org @ 2005-09-29 20:40 UTC (permalink / raw) To: gcc-bugs ------- Additional Comments From doko at debian dot org 2005-09-29 20:40 ------- The line number points to the inlined function, not to 'PyMarshal_ReadShortFromFile'. Is this intended? -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24129 ^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug middle-end/24129] [4.0 4.1 regression] bogus warning <var> is used uninitialized in this function 2005-09-29 20:23 [Bug middle-end/24129] New: [4.0 4.1 regression] bogus warning <var> is used uninitialized in this function doko at debian dot org ` (3 preceding siblings ...) 2005-09-29 20:40 ` doko at debian dot org @ 2005-09-29 20:44 ` pinskia at gcc dot gnu dot org 4 siblings, 0 replies; 6+ messages in thread From: pinskia at gcc dot gnu dot org @ 2005-09-29 20:44 UTC (permalink / raw) To: gcc-bugs ------- Additional Comments From pinskia at gcc dot gnu dot org 2005-09-29 20:44 ------- (In reply to comment #4) > The line number points to the inlined function, not to > 'PyMarshal_ReadShortFromFile'. Is this intended? In a way yes but that would be PR 17506 which I have not submitted the patch yet. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24129 ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2005-09-29 20:44 UTC | newest] Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2005-09-29 20:23 [Bug middle-end/24129] New: [4.0 4.1 regression] bogus warning <var> is used uninitialized in this function doko at debian dot org 2005-09-29 20:24 ` [Bug middle-end/24129] " doko at debian dot org 2005-09-29 20:26 ` pinskia at gcc dot gnu dot org 2005-09-29 20:35 ` pinskia at gcc dot gnu dot org 2005-09-29 20:40 ` doko at debian dot org 2005-09-29 20:44 ` 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).