I am using gcc 3.4.3 on solais 10. g++ -v: Reading specs from /usr/sfw/lib/gcc/i386-pc-solaris2.10/3.4.3/specs Configured with: /builds/sfw10-gate/usr/src/cmd/gcc/gcc-3.4.3/configure --prefix=/usr/sfw --with-as=/usr/sfw/bin/gas --with-gnu-as --with-ld=/usr/ccs/bin/ld --without-gnu-ld --enable-languages=c,c++ --enable-shared Thread model: posix gcc version 3.4.3 (csl-sol210-3_4-branch+sol_rpath)
If I compile the code, with % g++ reduced.C and run it, it returns as expected. The output is % ./a.out -NaN If I compile it with optimization % g++ reduced.C -O and run it, it does not return! If I remove the unused function from the code, the problem disappears. If I change the functions definition to take vector<double> instead of a vector<int>, the problem disappears. -- Summary: program hangs when compiled with -O Product: gcc Version: 3.4.3 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: boris dot breidenbach at physik dot uni-erlangen dot de GCC host triplet: csl-sol210-3_4-branch+sol_rpath http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27005