https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87564

            Bug ID: 87564
           Summary: Missing -Wuninitialized with -O0
           Product: gcc
           Version: 9.0
            Status: UNCONFIRMED
          Keywords: diagnostic
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: marxin at gcc dot gnu.org
            Blocks: 24639
  Target Milestone: ---

$ cat pr57832.c
int a;
unsigned b;
void c() {
  int d;
  for (int e = 0; e < 64; e += 16) {
    a += d;
    6 ? d += 10 + b + (b >> 3) : 0;
  }
}

$ gcc pr57832.c -c -Wall
[OK]
$ gcc pr57832.c -c -Wall  -O
pr57832.c: In function ā€˜c’:
pr57832.c:6:7: warning: ā€˜d’ is used uninitialized in this function
[-Wuninitialized]
     a += d;
       ^~


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=24639
[Bug 24639] [meta-bug] bug to track all Wuninitialized issues

Reply via email to