Hi Ian, > This patch to the Go frontend by Cherry Zhang enables escape analysis > for the runtime package in the Go frontend. The runtime package was > hard-coded non-escape, and the escape analysis was not run for the > runtime package. This patch removes the hard-code, and lets the > escape analysis decide. It is not allowed for local variables and > closures in the runtime to be heap allocated. This patch adds the > check that make sure that they indeed do not escape. > > The escape analysis is always run when compiling the runtime now. > > Bootstrapped and ran Go testsuite on x86_64-pc-linux-gnu. Committed > to mainline.
this broke Solaris bootstrap: /vol/gcc/src/hg/trunk/local/libgo/go/runtime/netpoll_solaris.go:182:57: error: n escapes to heap, not allowed in runtime if port_getn(portfd, &events[0], uint32(len(events)), &n, wait) < 0 { ^ /vol/gcc/src/hg/trunk/local/libgo/go/runtime/netpoll_solaris.go:176:11: error: zero escapes to heap, not allowed in runtime wait = &zero ^ /vol/gcc/src/hg/trunk/local/libgo/go/runtime/netpoll_solaris.go:174:6: error: .runtime.zero escapes to heap, not allowed in runtime var zero timespec ^ /vol/gcc/src/hg/trunk/local/libgo/go/runtime/netpoll_solaris.go:179:6: error: .runtime.events escapes to heap, not allowed in runtime var events [128]portevent ^ /vol/gcc/src/hg/trunk/local/libgo/go/runtime/netpoll_solaris.go:181:6: error: .runtime.n escapes to heap, not allowed in runtime var n uint32 = 1 ^ Fixed as follows. i386-pc-solaris2.11 and sparc-sun-solaris2.11 builds have completed, make check still running. Rainer -- ----------------------------------------------------------------------------- Rainer Orth, Center for Biotechnology, Bielefeld University
diff --git a/libgo/go/runtime/netpoll_solaris.go b/libgo/go/runtime/netpoll_solaris.go --- a/libgo/go/runtime/netpoll_solaris.go +++ b/libgo/go/runtime/netpoll_solaris.go @@ -84,6 +84,7 @@ func port_associate(port, source int32, //extern port_dissociate func port_dissociate(port, source int32, object uintptr) int32 +//go:noescape //extern port_getn func port_getn(port int32, evs *portevent, max uint32, nget *uint32, timeout *timespec) int32