http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58877
Bug ID: 58877
Summary: Spurious warning: ‘<anonymous>’ is used uninitialized
in this function
Product: gcc
Version: 4.4.6
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: bluesmissionnaire at gmail dot com
Created attachment 31087
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=31087&action=edit
source file that generates warning
g++-4.4 (GCC) 4.4.6 20110731 (Red Hat 4.4.6-3)
/usr/bin/g++-4.4 -Wall -c -O2 anonymous_may_be_used_uninitialized.cpp
warns:
anonymous_may_be_used_uninitialized.cpp: In member function ‘void
Sorter::sort()’:
anonymous_may_be_used_uninitialized.cpp:83: warning: ‘<anonymous>’ is used
uninitialized in this function
When I decrease optimization level to 1 this warning disappears.
I checked test files attached to multiple similar bugs but none of them
generated this warning. That is why I am creating a new bug.
Using http://gcc.godbolt.org/ I could check that assembly output is generated
for all gcc versions available there (v4.4.7 -> v4.8) so I suspect this problem
was somehowe fixed in 4.4.7. Anyway, I attach the code that I managed to get
and still have this warning. Maybe you want to add this to your regression
suite.