public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
* [Bug tree-optimization/21733] New: filecmp.c:252: warning: #n1# may be used uninitialized in this function @ 2005-05-24 7:48 olh at suse dot de 2005-05-24 8:00 ` [Bug tree-optimization/21733] " olh at suse dot de ` (2 more replies) 0 siblings, 3 replies; 8+ messages in thread From: olh at suse dot de @ 2005-05-24 7:48 UTC (permalink / raw) To: gcc-bugs if I understand the code flow in FileCmpCmd correctly, the first loop will initialize n1 and n2 because e1 = e2 = 0, and k1 && k2 is always < BSIZE. Even if the read() will return an error, the last check to return either TCL_ERROR or TCL_OK is not undefined. This is from http://ozlabs.org/~paulus/dirdiff-2.1.tar.gz /usr/lib/gcc/powerpc64-suse-linux/4.0.1/cc1 -fpreprocessed filecmp.i -quiet -dumpbase filecmp.c -auxbase filecmp -O3 -Wall -version -fPIC -o filecmp.s GNU C version 4.0.1 20050521 (prerelease) (SUSE Linux) (powerpc64-suse-linux) compiled by GNU C version 4.0.1 20050521 (prerelease) (SUSE Linux). GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096 filecmp.c: In function #FileCmpCmd#: filecmp.c:252: warning: #n2# may be used uninitialized in this function filecmp.c:252: warning: #n1# may be used uninitialized in this function -- Summary: filecmp.c:252: warning: #n1# may be used uninitialized in this function Product: gcc Version: 4.0.1 Status: UNCONFIRMED Severity: normal Priority: P2 Component: tree-optimization AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: olh at suse dot de CC: gcc-bugs at gcc dot gnu dot org GCC build triplet: powerpc-linux GCC host triplet: powerpc-linux GCC target triplet: powerpc-linux http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21733 ^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug tree-optimization/21733] filecmp.c:252: warning: #n1# may be used uninitialized in this function 2005-05-24 7:48 [Bug tree-optimization/21733] New: filecmp.c:252: warning: #n1# may be used uninitialized in this function olh at suse dot de @ 2005-05-24 8:00 ` olh at suse dot de 2005-05-24 14:35 ` [Bug middle-end/21733] " pinskia at gcc dot gnu dot org 2005-08-09 15:58 ` James dot Juran at baesystems dot com 2 siblings, 0 replies; 8+ messages in thread From: olh at suse dot de @ 2005-05-24 8:00 UTC (permalink / raw) To: gcc-bugs ------- Additional Comments From olh at suse dot de 2005-05-24 07:48 ------- Created an attachment (id=8957) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=8957&action=view) /tmp/filecmp.i.bz2 -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21733 ^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug middle-end/21733] filecmp.c:252: warning: #n1# may be used uninitialized in this function 2005-05-24 7:48 [Bug tree-optimization/21733] New: filecmp.c:252: warning: #n1# may be used uninitialized in this function olh at suse dot de 2005-05-24 8:00 ` [Bug tree-optimization/21733] " olh at suse dot de @ 2005-05-24 14:35 ` pinskia at gcc dot gnu dot org 2005-08-09 15:58 ` James dot Juran at baesystems dot com 2 siblings, 0 replies; 8+ messages in thread From: pinskia at gcc dot gnu dot org @ 2005-05-24 14:35 UTC (permalink / raw) To: gcc-bugs ------- Additional Comments From pinskia at gcc dot gnu dot org 2005-05-24 14:29 ------- This is not a regression, oh and this is much harder to get right which is why this is a "may"/"might" warning. -- What |Removed |Added ---------------------------------------------------------------------------- Component|tree-optimization |middle-end Keywords| |diagnostic Known to fail| |3.3.3 3.4.0 4.0.0 4.1.0 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21733 ^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug middle-end/21733] filecmp.c:252: warning: #n1# may be used uninitialized in this function 2005-05-24 7:48 [Bug tree-optimization/21733] New: filecmp.c:252: warning: #n1# may be used uninitialized in this function olh at suse dot de 2005-05-24 8:00 ` [Bug tree-optimization/21733] " olh at suse dot de 2005-05-24 14:35 ` [Bug middle-end/21733] " pinskia at gcc dot gnu dot org @ 2005-08-09 15:58 ` James dot Juran at baesystems dot com 2 siblings, 0 replies; 8+ messages in thread From: James dot Juran at baesystems dot com @ 2005-08-09 15:58 UTC (permalink / raw) To: gcc-bugs -- What |Removed |Added ---------------------------------------------------------------------------- CC| |James dot Juran at | |baesystems dot com http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21733 ^ permalink raw reply [flat|nested] 8+ messages in thread
[parent not found: <bug-21733-1216@http.gcc.gnu.org/bugzilla/>]
* [Bug middle-end/21733] filecmp.c:252: warning: #n1# may be used uninitialized in this function [not found] <bug-21733-1216@http.gcc.gnu.org/bugzilla/> @ 2005-11-26 7:39 ` gdr at gcc dot gnu dot org 2005-11-26 16:53 ` pinskia at gcc dot gnu dot org ` (2 subsequent siblings) 3 siblings, 0 replies; 8+ messages in thread From: gdr at gcc dot gnu dot org @ 2005-11-26 7:39 UTC (permalink / raw) To: gcc-bugs -- gdr at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Ever Confirmed|0 |1 Last reconfirmed|0000-00-00 00:00:00 |2005-11-26 07:39:55 date| | http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21733 ^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug middle-end/21733] filecmp.c:252: warning: #n1# may be used uninitialized in this function [not found] <bug-21733-1216@http.gcc.gnu.org/bugzilla/> 2005-11-26 7:39 ` gdr at gcc dot gnu dot org @ 2005-11-26 16:53 ` pinskia at gcc dot gnu dot org 2006-08-26 3:52 ` pinskia at gcc dot gnu dot org 2008-08-20 11:33 ` manu at gcc dot gnu dot org 3 siblings, 0 replies; 8+ messages in thread From: pinskia at gcc dot gnu dot org @ 2005-11-26 16:53 UTC (permalink / raw) To: gcc-bugs ------- Comment #3 from pinskia at gcc dot gnu dot org 2005-11-26 16:52 ------- k1=k2=0; e1=e2=0; for(;;) { if (!e1) if(k1<1111) { set n1 if (n1 <0) { .... break; } } if (!e2) if(k2<1111) { set n2 if (n2 <0) { .... break; } } } ... if (n1 < 0 || n2 < 0) return 1; L1: return 2; ------ The problem is that "n1 < 0 || n2 < 0" is being executed in one bb and not conditionaly -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21733 ^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug middle-end/21733] filecmp.c:252: warning: #n1# may be used uninitialized in this function [not found] <bug-21733-1216@http.gcc.gnu.org/bugzilla/> 2005-11-26 7:39 ` gdr at gcc dot gnu dot org 2005-11-26 16:53 ` pinskia at gcc dot gnu dot org @ 2006-08-26 3:52 ` pinskia at gcc dot gnu dot org 2008-08-20 11:33 ` manu at gcc dot gnu dot org 3 siblings, 0 replies; 8+ messages in thread From: pinskia at gcc dot gnu dot org @ 2006-08-26 3:52 UTC (permalink / raw) To: gcc-bugs ------- Comment #4 from pinskia at gcc dot gnu dot org 2006-08-26 03:52 ------- This is not a target specific bug either. -- pinskia at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- GCC build triplet|powerpc-linux | GCC host triplet|powerpc-linux | GCC target triplet|powerpc-linux | http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21733 ^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug middle-end/21733] filecmp.c:252: warning: #n1# may be used uninitialized in this function [not found] <bug-21733-1216@http.gcc.gnu.org/bugzilla/> ` (2 preceding siblings ...) 2006-08-26 3:52 ` pinskia at gcc dot gnu dot org @ 2008-08-20 11:33 ` manu at gcc dot gnu dot org 3 siblings, 0 replies; 8+ messages in thread From: manu at gcc dot gnu dot org @ 2008-08-20 11:33 UTC (permalink / raw) To: gcc-bugs ------- Comment #5 from manu at gcc dot gnu dot org 2008-08-20 11:32 ------- There is some connection with PR 36296 but perhaps they are not exactly the same issue. -- manu at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |manu at gcc dot gnu dot org BugsThisDependsOn| |36296 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21733 ^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2008-08-20 11:33 UTC | newest] Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2005-05-24 7:48 [Bug tree-optimization/21733] New: filecmp.c:252: warning: #n1# may be used uninitialized in this function olh at suse dot de 2005-05-24 8:00 ` [Bug tree-optimization/21733] " olh at suse dot de 2005-05-24 14:35 ` [Bug middle-end/21733] " pinskia at gcc dot gnu dot org 2005-08-09 15:58 ` James dot Juran at baesystems dot com [not found] <bug-21733-1216@http.gcc.gnu.org/bugzilla/> 2005-11-26 7:39 ` gdr at gcc dot gnu dot org 2005-11-26 16:53 ` pinskia at gcc dot gnu dot org 2006-08-26 3:52 ` pinskia at gcc dot gnu dot org 2008-08-20 11:33 ` manu 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).