[Bug tree-optimization/65178] New: incorrect -Wmaybe-uninitialized when nested loops
winter-gcc@bfw-online.de
gcc-bugzilla@gcc.gnu.org
Mon Feb 23 16:45:00 GMT 2015
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;
More information about the Gcc-bugs
mailing list