http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47749
Summary: Wrong function return value Product: gcc Version: 4.4.4 Status: UNCONFIRMED Severity: major Priority: P3 Component: c++ AssignedTo: unassig...@gcc.gnu.org ReportedBy: elpa.ri...@gmail.com This function returns always false, also if parameter is true Target is: arm-unknown-linux-uclibc If you: - define string s inside if loop - or instance string s as static - or add an explicit final return statement - or don't use string s the function works correctly. Examining the source code, one unwinding assembler statement is missing. #include <string> using namespace std; bool fn_bad(bool flag) { string s; if(flag) { s = "A"; return true; } }