A problem in Loongson 2F specific integer operation instruction patch
I have reported on gcc mailing list.
Also I found the solution:
Now I have built gcc-4.4 with my modified patch with "-march=mips3", and am building itself again using "-march=loongson2f".
Note that enabling -O2 in later stages is not working yet. Please check this bug report for more information if you are interested:
just heard from Kumba, this flag used together with -O1 will trigger this bug:
Optimize sibling and tail recursive calls.
Enabled at levels -O2, -O3, -Os.
The modified gcc 4.4 ebuild is here and some relevant libraries here.