From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1209 invoked by alias); 26 Jul 2010 18:50:47 -0000 Received: (qmail 853 invoked by uid 48); 26 Jul 2010 18:50:33 -0000 Date: Mon, 26 Jul 2010 18:50:00 -0000 Message-ID: <20100726185033.852.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug tree-optimization/45083] strange warning text from gcc In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "jakub 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: 2010-07/txt/msg02899.txt.bz2 ------- Comment #3 from jakub at gcc dot gnu dot org 2010-07-26 18:50 ------- Reduced testcase: /* { dg-do compile } */ /* { dg-options "-O2 -Wuninitialized" } */ struct S { char *a; unsigned b; unsigned c; }; extern int foo (const char *); extern void bar (int, int); static void baz (void) { struct S cs[1]; switch (cs->b) /* { dg-warning "cs\\[^\n\r\\]\.b\\[^\n\r\\]is used uninitialized" } */ { case 101: if (foo (cs->a)) /* { dg-warning "cs\\[^\n\r\\]\.a\\[^\n\r\\]may be used uninitialized" } */ bar (cs->c, cs->b); /* { dg-warning "cs\\[^\n\r\\]\.c\\[^\n\r\\]may be used uninitialized" } */ } } void test (void) { baz (); } -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45083