7a5585d645
Do this in both machdep.c:setregs() and trap.c:(end of syscall) for now. Need more analysis to see what is the best way... Fixes PR#3034 (Thanks very much to Ian Dall for the fix!)