From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13231 invoked by alias); 7 Feb 2009 21:29:58 -0000 Received: (qmail 13154 invoked by uid 48); 7 Feb 2009 21:29:46 -0000 Date: Sat, 07 Feb 2009 21:29:00 -0000 Message-ID: <20090207212946.13153.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug middle-end/30856] missing uninitialized variable warning (CCP) In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "manu 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: 2009-02/txt/msg00685.txt.bz2 ------- Comment #12 from manu at gcc dot gnu dot org 2009-02-07 21:29 ------- This is a duplicate of 18501. CCP assumes y is always 23. Reordering passes just changes the set of false negatives/positives. For example, if you move the warning before CCP, then you get a warning for this case: int f(int x) { int y; int x = 42; if (x == 42) y = 23; return y; } A more complete analysis is here: http://gcc.gnu.org/ml/gcc/2005-11/msg00028.html And some random ideas are here: http://gcc.gnu.org/wiki/Better_Uninitialized_Warnings#problem_ccp How other compilers get this right? I don't know, but ideas and patches are welcome. *** This bug has been marked as a duplicate of 18501 *** -- manu at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- BugsThisDependsOn| |18501 Status|REOPENED |RESOLVED Resolution| |DUPLICATE http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30856