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 c++/84357] New: Incorrect 'foo' is used uninitialized with -O3


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

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