You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
cmd/compile: "bad code" with very large return value #20780
package p
typeSstruct {
iinterface {
f() [107374100]int
}
}
Compiling this with 1.9beta1 results in:
$ go tool compile x.go
compile: bad code
Same for 1.8.
Unlike its brethren, #20779 and #20778, the size of the return value here seems reasonable enough that it might be worth briefly investigating for 1.10, just in case.
Error is coming from here src/cmd/internal/obj/pcln.go
But in general, it's problem of offset, it's overflowing int32:
<autogenerated>:1:0: offset too large in 00022 (<autogenerated>:1) MOVQ BP, -2147483656(SP)
<autogenerated>:1:0: offset too large in 00030 (<autogenerated>:1) LEAQ -2147483656(SP), BP
<autogenerated>:1:0: offset too large in 00096 (<autogenerated>:1) MOVQ DX, ""..autotmp_2-3221225472(SP)
<autogenerated>:1:0: offset too large in 00109 (<autogenerated>:1) LEAQ ""..autotmp_2-3221225464(SP), DI
<autogenerated>:1:0: offset too large in 00125 (<autogenerated>:1) MOVQ ""..autotmp_2-3221225472(SP), DX
<autogenerated>:1:0: offset too large in 00149 (<autogenerated>:1) LEAQ ""..autotmp_2-3221225464(SP), SI
<autogenerated>:1:0: offset too large in 00165 (<autogenerated>:1) MOVQ -2147483656(SP), BP
bradfitz@gdev:~$ go version
go version devel +992ce90 Wed Nov 29 03:24:52 2017 +0000 linux/amd64
bradfitz@gdev:~$ go tool compile x.go
<autogenerated>:1:0: overflow in spadj: 0 + 1717985616 = 1717985616
compile: bad code
It's been this way for 2 releases, so might as well be 3, sorry.
Activity
v47 commentedon Jul 10, 2017
Error is coming from here src/cmd/internal/obj/pcln.go
But in general, it's problem of offset, it's overflowing int32:
bradfitz commentedon Nov 29, 2017
More detail at Go tip, but still present:
It's been this way for 2 releases, so might as well be 3, sorry.
/cc @mdempsky
gopherbot commentedon May 29, 2018
Change https://golang.org/cl/115195 mentions this issue:
cmd/compile: include callee args section when checking frame too large