Hello to everybody, I discovered a bug in multiply/division trap code for sun4m CPUs. This bug comes from not quite correct register declaration for inline assembly. According to GCC manual , it is not enough to declare a variable (register) as output only if it is an input variable as well. A special definitions "0" to "9" should match input variables and output variables. Due to this, GCC produced incorrect assembly code for muldiv trap function and division results were incorrect. The attached patch fixes this. I attached also a small program to test this bug. I discovered this bug in the 2.4.27 kernel compiled with cross-compiler x86->sparc GCC 3.3.4. I tested also kernel 2.4.28 - it also has the bug. To my surprise, the 2.4.26 kernel does not show this bug (C code is the same as in 2.4.27 - it works by some accident). Also, the bug does not appear if debug information is printed from inside the muldiv function. My guess is that a new function for calculating instruction address put some stress on register usage which forces GCC to allocate registers differently since kernel 2.4.27. I got the same results using Gentoo GCC 3.3.3 on Sparcstation 20 (native compilation), i.e. 2.4.26 works correctly, 2.4.27 and 2.4.28 does not. I suppose the patch should be applied to 2.6 branch as well, as it contains the same incorrect code. Kind regards, Krzysztof Helt