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
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@mattn
Copy link
Member

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 ALTree added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Aug 21, 2021
@ALTree
Copy link
Member

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.

@gopherbot gopherbot added the compiler/runtime Issues related to the Go compiler and/or runtime. label Jul 13, 2022
@seankhliao seankhliao added this to the Unplanned milestone Aug 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
Status: Triage Backlog
Development

No branches or pull requests

4 participants