Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/compile: can not compile large function #47866

Open
mattn opened this issue Aug 21, 2021 · 1 comment
Open

cmd/compile: can not compile large function #47866

mattn opened this issue Aug 21, 2021 · 1 comment

Comments

@mattn
Copy link
Member

@mattn mattn commented Aug 21, 2021

What version of Go are you using (go version)?

$ go version
go version devel go1.18-e9e0d1ef70 Fri Aug 20 03:25:36 2021 +0000 windows/amd64

Does this issue reproduce with the latest release?

Yes.

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
set GO111MODULE=on
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\mattn\AppData\Local\go-build
set GOENV=C:\Users\mattn\AppData\Roaming\go\env
set GOEXE=.exe
set GOEXPERIMENT=
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOINSECURE=
set GOMODCACHE=C:\Users\mattn\go\pkg\mod
set GONOPROXY=
set GONOSUMDB=
set GOOS=windows
set GOPATH=C:\Users\mattn\go
set GOPRIVATE=
set GOPROXY=https://proxy.golang.org,direct
set GOROOT=C:\dev\go
set GOSUMDB=sum.golang.org
set GOTMPDIR=
set GOTOOLDIR=C:\dev\go\pkg\tool\windows_amd64
set GOVCS=
set GOVERSION=devel go1.18-e9e0d1ef70 Fri Aug 20 03:25:36 2021 +0000
set GCCGO=gccgo
set AR=ar
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set GOMOD=C:\Users\mattn\go\src\github.com\mattn\go-iseven\go.mod
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -mthreads -fmessage-length=0 -fdebug-prefix-map=C:\Users\mattn\AppData\Local\Temp\go-build1034691121=/tmp/go-build -gno-record-gcc-switches

What did you do?

$ git clone https://github.com/mattn/go-iseven
$ cd go-iseven
$ go build

What did you expect to see?

Compilation successfully.

What did you see instead?

Compilation take too long times. I couldn't build this for few minutes. I'm using Windows 10. 16GB RAM.

This is a joke project that provide same function with https://github.com/samuelmarina/is-even. The code is generated from js code. The compilation require too many CPU usage and memory.

@ALTree ALTree changed the title Can not compile large function cmd/compile: can not compile large function Aug 21, 2021
@ALTree
Copy link
Member

@ALTree ALTree commented Aug 21, 2021

Well, it's a function with a 100MB body... Not sure how much time it would be reasonable to wait for it to be compiled, but I'm not surprised it takes more than a few minutes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants