-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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: hang in ssa.(*regAllocState).computeLive
when optimizations are disabled
#52180
Comments
-N
option
With a few flag tweaks (removing
|
The hang occurs in the same place with
|
-N
optionssa.(*regAllocState).computeLive
when optimizations are disabled
Another thing: the command is generated with the flag |
(FWIW I think the |
This code has a huge init function (perhaps from the map literal in init.go?). In -N mode the function has 330000+ basic blocks. It appears to me that the compiler isn't stuck in an infinite loop, but that loop has something quadratic. It runs slower and slower and eventually got killed (probably OOM) on my machine. So perhaps something quadratic in memory as well. |
This is similar to #51543, perhaps the fix ( https://go-review.googlesource.com/c/go/+/397318 ) or an improved version of it would apply here. |
It is still slow/hanging at tip. I think CL 397318 improves the liveness computation for debug info generation, but this is one is in the register allocator. I'll take another look. |
Rolling forward to 1.20. Please comment if you disagree. Thanks. |
Any update on this? |
Change https://go.dev/cl/475339 mentions this issue: |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
To reproduce pull my package faker:
$ git clone https://github.com/pioz/faker.git $ cd faker $ go tool compile -o faker.a -lang=go1.14 -goversion go1.18 -N -l -c 4 -complete -shared -nolocalimports -pack address.go builder.go color.go country.go currency.go faker.go gender.go init.go internet.go lang.go misc.go name.go number.go pool.go random.go sentence.go slice.go string.go time.go unique.go utils.go
What did you expect to see?
I expect the output file
faker.a
.What did you see instead?
The command run, I think forever (I let it run all night).
If I remove the option
-N
(disable optimizations) the command compiles the filefaker.a
as expected.The text was updated successfully, but these errors were encountered: