This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug tree-optimization/65178] New: incorrect -Wmaybe-uninitialized when nested loops


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;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]