"Kaz Kylheku" <firstname.lastname@example.org> wrote on December 07, 2007:
Not really a kernel-related question. I've discovered that GCC 4.1.1
(which I'm not using for kernel compiling, but user space) generates
branch likely instructions by default, even though the documentation
says that their use is off by default for MIPS32 and MIPS64, because
That's because the compiler is not configured correctly. The default CPU
string "from-abi" ends up being used, and so the target ISA is MIPS III.
I managed to root-cause the original problem, and moments ago filed this bug
GCC can screw up when doing branch delay slot filling, because in computing
register liveness, it makes an incorrectly computed assumption about what
registers are clobbered by a CALL_INSN. By unfortunate coincidence, it's
possible for an instruction which restores the caller's GP to be wrongly
moved into a non-annulled delay slot, wreaking havoc on the fall-through
path where GP is in fact used. Jumps and data accesses are then attempted
using what is possibly the wrong global offset table.