From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14764 invoked by alias); 28 May 2008 07:31:47 -0000 Received: (qmail 14555 invoked by uid 48); 28 May 2008 07:31:04 -0000 Date: Wed, 28 May 2008 07:31:00 -0000 Message-ID: <20080528073104.14554.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug middle-end/36296] wrong warning about potential uninitialized variable In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "pinskia 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-05/txt/msg02032.txt.bz2 ------- Comment #6 from pinskia at gcc dot gnu dot org 2008-05-28 07:31 ------- (In reply to comment #5) > BTW, the i = i trick it only works in the initializer and not as a statement after the fact. That is: #include int foo (int x) { int y = y; assert (x == 0 || x == 1); if (x == 0) y = 1; else if (x == 1) y = 2; return y; } Will work, also with the jump threading, GCC should be able to figure out that y is always inlined (except when -DNDEBUG is used). -- Pinski -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36296