Commit b53d2f5b authored by Anthony Martin's avatar Anthony Martin

cmd/gc: make the fpu handle all exceptions on Plan 9

The compilers expect to not be interrupted by floating
point exceptions. On Plan 9, every process starts with
interrupts enabled for invalid operation, stack overflow,
and divide by zero exceptions.

LGTM=rsc
R=rsc, 0intro
CC=golang-codereviews
https://golang.org/cl/72750043
parent 189397df
...@@ -172,10 +172,6 @@ catcher(void *v, char *s) ...@@ -172,10 +172,6 @@ catcher(void *v, char *s)
{ {
USED(v); USED(v);
if(strncmp(s, "sys: fp: invalid operation", 26) == 0) {
noted(NCONT);
return;
}
if(strncmp(s, "sys: trap: fault read", 21) == 0) { if(strncmp(s, "sys: trap: fault read", 21) == 0) {
if(nsavederrors + nerrors > 0) if(nsavederrors + nerrors > 0)
errorexit(); errorexit();
...@@ -211,6 +207,8 @@ main(int argc, char *argv[]) ...@@ -211,6 +207,8 @@ main(int argc, char *argv[])
#ifdef PLAN9 #ifdef PLAN9
notify(catcher); notify(catcher);
// Tell the FPU to handle all exceptions.
setfcr(FPPDBL|FPRNR);
#endif #endif
// Allow GOARCH=thestring or GOARCH=thestringsuffix, // Allow GOARCH=thestring or GOARCH=thestringsuffix,
// but not other values. // but not other values.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment