On Thu, Jan 11, 2018 at 1:46 AM, Rainer Orth <r...@cebitec.uni-bielefeld.de> wrote: > >> On Wed, Jan 10, 2018 at 5:42 AM, Ian Lance Taylor <i...@golang.org> wrote: >>> >>> Whoops, there's a bug on big-endian 32-bit systems. I'm testing >>> https://golang.org/cl/87135. >> >> Committed as follows. > > thanks, that fixed quite a lot of the failures. > > However, many others remain, too many to report here. I've filed PR > go/83787 to capture those.
Thanks. I found the problem: there is a new function makechan that takes a size argument of type int, and the old makechan, that took int64, is now makechan64. Since the size argument was the last one, this worked fine except on 32-bit big-endian systems. Fixed with this patch. Bootstrapped and tested on x86_64-pc-linux-gnu and sparc-sun-solaris2.12. Committed to mainline. Ian
Index: gcc/go/gofrontend/MERGE =================================================================== --- gcc/go/gofrontend/MERGE (revision 256820) +++ gcc/go/gofrontend/MERGE (working copy) @@ -1,4 +1,4 @@ -1072286ca9249bd6f75628aead325a66286bcf5b +925635f067d40d30acf565b620cc859ee7cbc990 The first line of this file holds the git revision number of the last merge done from the gofrontend repository. Index: gcc/go/gofrontend/escape.cc =================================================================== --- gcc/go/gofrontend/escape.cc (revision 256820) +++ gcc/go/gofrontend/escape.cc (working copy) @@ -360,6 +360,7 @@ Node::op_format() const break; case Runtime::MAKECHAN: + case Runtime::MAKECHAN64: case Runtime::MAKEMAP: case Runtime::MAKESLICE: case Runtime::MAKESLICE64: @@ -1602,6 +1603,7 @@ Escape_analysis_assign::expression(Expre switch (fe->runtime_code()) { case Runtime::MAKECHAN: + case Runtime::MAKECHAN64: case Runtime::MAKEMAP: case Runtime::MAKESLICE: case Runtime::MAKESLICE64: @@ -2284,6 +2286,7 @@ Escape_analysis_assign::assign(Node* dst switch (fe->runtime_code()) { case Runtime::MAKECHAN: + case Runtime::MAKECHAN64: case Runtime::MAKEMAP: case Runtime::MAKESLICE: case Runtime::MAKESLICE64: @@ -3056,6 +3059,7 @@ Escape_analysis_flood::flood(Level level switch (call->fn()->func_expression()->runtime_code()) { case Runtime::MAKECHAN: + case Runtime::MAKECHAN64: case Runtime::MAKEMAP: case Runtime::MAKESLICE: case Runtime::MAKESLICE64: Index: gcc/go/gofrontend/expressions.cc =================================================================== --- gcc/go/gofrontend/expressions.cc (revision 256820) +++ gcc/go/gofrontend/expressions.cc (working copy) @@ -7565,7 +7565,10 @@ Builtin_call_expression::lower_make(Stat else if (is_chan) { Expression* type_arg = Expression::make_type_descriptor(type, type_loc); - call = Runtime::make_call(Runtime::MAKECHAN, loc, 2, type_arg, len_arg); + Runtime::Function code = Runtime::MAKECHAN; + if (!len_small) + code = Runtime::MAKECHAN64; + call = Runtime::make_call(code, loc, 2, type_arg, len_arg); } else go_unreachable(); Index: gcc/go/gofrontend/runtime.def =================================================================== --- gcc/go/gofrontend/runtime.def (revision 256593) +++ gcc/go/gofrontend/runtime.def (working copy) @@ -139,7 +139,8 @@ DEF_GO_RUNTIME(MAPITERNEXT, "runtime.map // Make a channel. -DEF_GO_RUNTIME(MAKECHAN, "runtime.makechan", P2(TYPE, INT64), R1(CHAN)) +DEF_GO_RUNTIME(MAKECHAN, "runtime.makechan", P2(TYPE, INT), R1(CHAN)) +DEF_GO_RUNTIME(MAKECHAN64, "runtime.makechan64", P2(TYPE, INT64), R1(CHAN)) // Send a value on a channel. DEF_GO_RUNTIME(CHANSEND, "runtime.chansend1", P2(CHAN, POINTER), R0()) Index: libgo/go/runtime/chan.go =================================================================== --- libgo/go/runtime/chan.go (revision 256593) +++ libgo/go/runtime/chan.go (working copy) @@ -26,6 +26,7 @@ import ( // themselves, so that the compiler will export them. // //go:linkname makechan runtime.makechan +//go:linkname makechan64 runtime.makechan64 //go:linkname chansend1 runtime.chansend1 //go:linkname chanrecv1 runtime.chanrecv1 //go:linkname chanrecv2 runtime.chanrecv2