-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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: internal compiler error: not lowered: v654, Int64Hi INT32 INT on 32bit GOARCHs #61041
Comments
Seems to compile successfully at tip: https://go.dev/play/p/Kn0eExXNMsW?v=gotip I think this was fixed by https://go-review.googlesource.com/c/go/+/506115 or https://go-review.googlesource.com/c/go/+/506055. |
I just noticed this was reported as failing on 386 and arm, not amd64 like the Go playground. But even checking out 1.21rc2, running make.bash, and using I tried the go1.21rc2 linux release binary too, and can't reproduce either. Can anyone else reproduce this failure? |
I was able to reproduce it. Make sure to pull the test case from the Go playground, not from the abbreviated test case in the initial post. |
I did:
|
Hmmm.
|
But I can't reproduce it with 1.21rc2, only with HEAD. |
I ran |
I suspect it was introduced by https://go.dev/cl/505756 by @randall77 . |
|
I compared the GOSSAFUNC=f output for the function, with and without the extra switch statement. I noticed this discrepancy: When the switch statement is absent, the final return block is constructed as:
and then after phi-insertion becomes:
However, when the switch statement is present, then before phi-insertion we have:
and after phi-insertion:
Note that v679 was inserted as a Phi of type int64, whereas v672 and v9 are both int-typed. I'm guessing this is somehow related to the fact that the "ternaryVar" pseudo-variable is being used in two min/max expressions within the same function, but with different types. |
Change https://go.dev/cl/506679 mentions this issue: |
The large-function phi placement algorithm evidently doesn't like the same pseudo-variable being used to represent expressions of varying types. Instead, use the same tactic as used for "valVar" (ssa.go:6585--6587), which is to just generate a fresh marker node each time. Maybe we could just use the OMIN/OMAX nodes themselves as the key (like we do for OANDAND/OOROR), but that just seems needlessly risky for negligible memory savings. Using fresh marker values each time seems obviously safe by comparison. Fixes golang#61041. Change-Id: Ie2600c9c37b599c2e26ae01f5f8a433025d7fd08 Reviewed-on: https://go-review.googlesource.com/c/go/+/506679 TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com> Run-TryBot: Matthew Dempsky <mdempsky@google.com> Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
(full reproducer here: https://go.dev/play/p/_bv7gsRF91v?v=gotip)
fails on
GOARCH=arm
too.cc @randall77 @cherrymui
The text was updated successfully, but these errors were encountered: