When compiling the code below with current mainline, I get a warning that was not emitted a few days ago.
#include <iostream> using namespace std; int main() { int x; cin >> x; cout << x << endl; } [EMAIL PROTECTED]:~/tmp> g++ -v -Wuninitialized -O bla.cc Using built-in specs. Target: x86_64-unknown-linux-gnu Configured with: /home/martin/software/gcc/configure --quiet --prefix=/home/martin/software/ugcc --enable-languages=c++,fortran --enable-checking=release Thread model: posix gcc version 4.2.0 20060102 (experimental) /home/martin/software/ugcc/libexec/gcc/x86_64-unknown-linux-gnu/4.2.0/cc1plus -quiet -v -D_GNU_SOURCE bla.cc -quiet -dumpbase bla.cc -mtune=k8 -auxbase bla -O -Wuninitialized -version -o /tmp/ccSrl6e0.s ignoring nonexistent directory "/home/martin/software/ugcc/lib/gcc/x86_64-unknown-linux-gnu/4.2.0/../../../../x86_64-unknown-linux-gnu/include" #include "..." search starts here: #include <...> search starts here: /home/martin/software/ugcc/lib/gcc/x86_64-unknown-linux-gnu/4.2.0/../../../../include/c++/4.2.0 /home/martin/software/ugcc/lib/gcc/x86_64-unknown-linux-gnu/4.2.0/../../../../include/c++/4.2.0/x86_64-unknown-linux-gnu /home/martin/software/ugcc/lib/gcc/x86_64-unknown-linux-gnu/4.2.0/../../../../include/c++/4.2.0/backward /usr/local/include /home/martin/software/ugcc/include /home/martin/software/ugcc/lib/gcc/x86_64-unknown-linux-gnu/4.2.0/include /usr/include End of search list. GNU C++ version 4.2.0 20060102 (experimental) (x86_64-unknown-linux-gnu) compiled by GNU C version 4.2.0 20060102 (experimental). GGC heuristics: --param ggc-min-expand=98 --param ggc-min-heapsize=127998 Compiler executable checksum: daaafcb7365564947efcbce06b4e70bb bla.cc: In function int main(): bla.cc:7: warning: x may be used uninitialized in this function as -V -Qy -o /tmp/ccbnSz84.o /tmp/ccSrl6e0.s GNU assembler version 2.16.91.0.2 (x86_64-suse-linux) using BFD version 2.16.91.0.2 20050720 (SuSE Linux) /home/martin/software/ugcc/libexec/gcc/x86_64-unknown-linux-gnu/4.2.0/collect2 --eh-frame-hdr -m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 /usr/lib/../lib64/crt1.o /usr/lib/../lib64/crti.o /home/martin/software/ugcc/lib/gcc/x86_64-unknown-linux-gnu/4.2.0/crtbegin.o -L/home/martin/software/ugcc/lib/gcc/x86_64-unknown-linux-gnu/4.2.0 -L/home/martin/software/ugcc/lib/gcc/x86_64-unknown-linux-gnu/4.2.0/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/home/martin/software/ugcc/lib/gcc/x86_64-unknown-linux-gnu/4.2.0/../../.. /tmp/ccbnSz84.o -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /home/martin/software/ugcc/lib/gcc/x86_64-unknown-linux-gnu/4.2.0/crtend.o /usr/lib/../lib64/crtn.o This warning is not emitted by the current gomp branch, 4.1 branch and 4.0 branch Is this intended behavior? -- Summary: [g++, regression?] Bogus "uninitialized" warning Product: gcc Version: 4.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: martin at mpa-garching dot mpg dot de GCC build triplet: x86_64-unknown-linux-gnu GCC host triplet: x86_64-unknown-linux-gnu GCC target triplet: x86_64-unknown-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25649