From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24406 invoked by alias); 23 Feb 2015 15:49:55 -0000 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 Received: (qmail 24371 invoked by uid 48); 23 Feb 2015 15:49:51 -0000 From: "winter-gcc@bfw-online.de" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/65178] New: incorrect -Wmaybe-uninitialized when nested loops Date: Mon, 23 Feb 2015 16:45:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 4.9.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: winter-gcc@bfw-online.de X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-02/txt/msg02519.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65178 Bug ID: 65178 Summary: incorrect -Wmaybe-uninitialized when nested loops Product: gcc Version: 4.9.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: winter-gcc@bfw-online.de Created attachment 34845 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=34845&action=edit Testcase This program incorrectly warns about an uninitialized variable. If one is to delete the innermost loop definition (leaving the loop body intact), the warning would not be displayed. --- main.c 2015-02-23 16:48:56.027694790 +0100 +++ main2.c 2015-02-23 16:49:13.585385504 +0100 @@ -10,7 +10,7 @@ { char *buf; char *p = 0; for (bool a = true;; a = false) - { for (char *s = c; *s; ++s) + { // for (char *s = c; *s; ++s) { if (!a) *p = 'a'; } if (!a) break;