Created attachment 363153 [details] test program that triggers this bug Description of problem: There is a problem with the -O1 optimization together with inline code, loops, class constructors and temporal objects. Version-Release number of selected component (if applicable): gcc-4.4.1-2.fc11 How reproducible: see attached test program. here the results from a Fedora 11 system with the mentioned compiler > /usr/bin/gcc -lstdc++ test.cpp > ./a.out val1=1234, val2=0 val1=1234, val2=1 --> OK > /usr/bin/gcc -lstdc++ -O1 test.cpp > ./a.out val1=-1081510952, val2=-30798 val1=-1081510952, val2=-30798 --> FAIL > /usr/bin/gcc -lstdc++ -O2 test.cpp > ./a.out val1=1234, val2=0 val1=1234, val2=1 --> OK PS: I've already created a bug report for Gentoo Linux but the same happens on Fedora 11 too (that's why I create also a Fedora bug report) https://bugs.gentoo.org/show_bug.cgi?id=286982
Works just fine with gcc-4.4.1-17.