https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67196
Bug ID: 67196
Summary: Another false positive from -Wmaybe-uninitialized
Product: gcc
Version: 6.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: tree-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: dmalcolm at gcc dot gnu.org
Target Milestone: ---
Created attachment 36176
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=36176&action=edit
Reproducer
The attached generates a false -Wmaybe-uninitialized warning:
$ gcc -O1 -Wall -c diagnostic.cc
diagnostic.cc: In function ‘void test(int)’:
diagnostic.cc:28:28: warning: ‘first_caption_idx’ may be used uninitialized in
this function [-Wmaybe-uninitialized]
foo (first_caption_idx); /* get bogus warning here at -O1 and above */
^
Seen with gcc 4.8.3 and with trunk (specifically, r226697).