From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29590 invoked by alias); 19 Aug 2008 01:33:14 -0000 Received: (qmail 29328 invoked by uid 48); 19 Aug 2008 01:31:54 -0000 Date: Tue, 19 Aug 2008 01:33:00 -0000 Message-ID: <20080819013154.29327.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug middle-end/36296] bogus uninitialized warning (loop representation) In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "vincent at vinc17 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-08/txt/msg01350.txt.bz2 ------- Comment #11 from vincent at vinc17 dot org 2008-08-19 01:31 ------- (In reply to comment #10) > If I replace the value 2 by 1 I still get the warning in GCC 4.4, so that > really sounds strange. Are you sure about that? Yes and here Debian's GCC 4.4 snapshot has the same behavior as GCC 4.3.1 (also from Debian). Also, the optimized trees are not the same for 1 and 2. vin% cat tst.c void *foo (void); void bar (void *); void f (void) { int init = 0; void *p; while (1) { if (init == 0) { p = foo (); init = INIT; } bar (p); } } vin% gcc --version gcc.real (Debian 4.3.1-9) 4.3.1 Copyright (C) 2008 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. vin% gcc -Wall -O2 tst.c -c -fdump-tree-optimized -DINIT=1 vin% cat tst.c.126t.optimized ;; Function f (f) Analyzing Edge Insertions. f () { void * p; : p = foo (); : bar (p); goto ; } vin% gcc -Wall -O2 tst.c -c -fdump-tree-optimized -DINIT=2 tst.c: In function 'f': tst.c:7: warning: 'p' may be used uninitialized in this function vin% cat tst.c.126t.optimized ;; Function f (f) Analyzing Edge Insertions. f () { void * p; int init; : init = 0; : if (init == 0) goto ; else goto ; : p = foo (); init = 2; : bar (p); goto ; } vin% /usr/lib/gcc-snapshot/bin/gcc --version gcc (Debian 20080802-1) 4.4.0 20080802 (experimental) [trunk revision 138551] Copyright (C) 2008 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. vin% /usr/lib/gcc-snapshot/bin/gcc -Wall -O2 tst.c -c -DINIT=1 vin% /usr/lib/gcc-snapshot/bin/gcc -Wall -O2 tst.c -c -DINIT=2 tst.c: In function 'f': tst.c:7: warning: 'p' may be used uninitialized in this function vin% -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36296