From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16560 invoked by alias); 17 Jun 2008 09:53:52 -0000 Received: (qmail 16459 invoked by uid 48); 17 Jun 2008 09:53:08 -0000 Date: Tue, 17 Jun 2008 09:53:00 -0000 Subject: [Bug middle-end/36550] New: Wrong "may be used uninitialized" warning X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "aldot at gcc dot gnu dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2008-06/txt/msg01024.txt.bz2 Yet another one. It behaves the same for 4.1.2 and current trunk. $ gcc -Os -Wuninitialized -c uninit-J.c uninit-J.c: In function 'pr': uninit-J.c:7: warning: 'bug' may be used uninitialized in this function $ cat uninit-J.c /* { dg-do compile } */ /* { dg-options "-Os -Wuninitialized" } */ void bail(void) __attribute__((noreturn)); unsigned check(void); int pr(char**argv) { char *bug; if (check()) { if (*argv) bug = *++argv; } else { bug = *argv++; if (!*argv) bail(); } /* now bug is set except if (check() && !*argv) */ if (check()) { if (!*argv) return 0; } /* if we ever get here then bug is set */ return *bug != 'X'; } -- Summary: Wrong "may be used uninitialized" warning Product: gcc Version: 4.1.2 Status: UNCONFIRMED Keywords: diagnostic Severity: normal Priority: P3 Component: middle-end AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: aldot at gcc dot gnu dot org OtherBugsDependingO 24639 nThis: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36550