This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/84357] New: Incorrect 'foo' is used uninitialized with -O3
- From: "janisozaur+gcc at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 13 Feb 2018 09:39:17 +0000
- Subject: [Bug c++/84357] New: Incorrect 'foo' is used uninitialized with -O3
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84357
Bug ID: 84357
Summary: Incorrect 'foo' is used uninitialized with -O3
Product: gcc
Version: 8.0.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: janisozaur+gcc at gmail dot com
Target Milestone: ---
Created attachment 43402
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=43402&action=edit
reproducer
Compile attachment with `-O3 -Werror -Wuninitialized`, tested with GCC 8.0.1
20180211 on wandbox: https://wandbox.org/permlink/jW0p9vIwIwHOEmEb
prog.c: In function 'foo':
prog.c:24:14: error: 'i' is used uninitialized in this function
[-Werror=uninitialized]
for (int i = 0; i < COUNT; i++)
^
cc1: all warnings being treated as errors