http://gcc.gnu.org/ml/gcc-patches/2008-05/msg01756.html
Compiling with -O0 prevents the compiler from optimizing away the required instructions but is an unacceptable long term solution.
The MIPS compiler appears to optimize away instructions to restore the GP register after some function calls. This causes a problem when the called function clobbers the GP register. This appears to be a known issue in the gcc MIPS compiler.
1. Unzip the patch under [install_dir]/updates
2. Install the patch CD by entering the patch CD directory and run setup_linux.
3. This is a source only patch so you will have to build your packages with the new compiler.
4. Issue a make fs and make the kernel in a configured directory.
5. Upload the kernel and rootfs into the target and boot it up.