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

Reply via email to