From 7056ec6bfd99e204ebf12dc20fe4c78ad623b581 Mon Sep 17 00:00:00 2001 From: Akshat Kumar Date: Tue, 10 Apr 2012 15:14:10 -0400 Subject: [PATCH] runtime: fix floating point exception on Plan 9 MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Change 5660047 moved an FLDCW instruction that disables invalid operand traps into runtime·asminit, which is called from runtime·mstart. Thus, runtime·check is being called prior to setting the appropriate control bits, which on any QNaN comparison will cause Plan 9 to take an invalid operand trap. This change loads the control bits (for Plan 9) prior to runtime·check. Ideally, this should be done before the QNaN checks on any system, but possibly other kernels simply don't ever trap on invalid operands. R=golang-dev, rminnich CC=golang-dev, john, rsc https://golang.org/cl/5939045 --- src/pkg/runtime/rt0_plan9_386.s | 1 + 1 file changed, 1 insertion(+) diff --git a/src/pkg/runtime/rt0_plan9_386.s b/src/pkg/runtime/rt0_plan9_386.s index b56c8b325d..56f3a0f6c7 100644 --- a/src/pkg/runtime/rt0_plan9_386.s +++ b/src/pkg/runtime/rt0_plan9_386.s @@ -25,6 +25,7 @@ argv_fix: ADDL $4, BP LOOP argv_fix + CALL runtime·asminit(SB) JMP _rt0_386(SB) DATA runtime·isplan9(SB)/4, $1 -- 2.48.1