http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54066
Bug #: 54066 Summary: wrong-code at -O0 Classification: Unclassified Product: gcc Version: 4.6.3 Status: UNCONFIRMED Severity: major Priority: P3 Component: middle-end AssignedTo: unassig...@gcc.gnu.org ReportedBy: wbr...@gmail.com GCC 4.6.3 1 GCC 4.7.1 2 #include <iostream> using namespace std; struct c { char* Achit; c() { Achit = new char[1]; } unsigned char uint8() { unsigned char lires = 1; Achit += 1; return lires; }; }; int main() { c* Lf = new c(); char* Lc1 = Lf->Achit; Lf->Achit += Lf->uint8(); cout << Lf->Achit - Lc1 << endl; }