Compiling with "-Wall -O2" results in the correct execution of this code. Compiling with "-Wall -O2 -finline-functions" with the code as attached, causes the assertion to fail, which should not happen. However, if you uncomment either of the std::cout lines in Decoder.cc or DecoderDerivs.cc and recompile with "-Wall -O2 -finline-functions", the assertion does not fail. It appears if you force the any of the "node" variables to be read, the assertion will not fail (the correct execution).
-- Summary: incorrect execution via addition of -finline-functions Product: gcc Version: 4.4.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: tim dot dawborn at gmail dot com http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41986