Hello all, It seems that current gcc suffers from a branching bug. Please see http://bugs.gentoo.org/show_bug.cgi?id=203543 for the full bug details. As stated in the bug details, simply compile the attached test case with different optimisation levels and the result will differ. This seems to be happening for gcc-4.1.2 up to the latest 4.3. Gentoo's gcc includes the latest cbranch patches found in the debian one. Let me know if more info is needed. Regards, Guy -- Guy Martin Gentoo Linux - HPPA port lead
int ret1() { return -1; } int main(int argc, char **argv) { int i = ret1(); if(i >= -10000) { i = -i; } // should execute return i+10; }