-
Notifications
You must be signed in to change notification settings - Fork 18k
cmd/compile: internal compiler error: panic: interface conversion: ir.Node is *ir.BasicLit, not *ir.ConstExpr #58339
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
Comments
Sounds like the non-unified frontend importer import The non-unified frontend is gone at tip, so I think there's nothing to do here. cc @mdempsky |
We should check 1.19. If it fails there we should arrange a backport for that. |
Inline static init is only added in 1.20, 1.19 have no effect. |
Can confirm this issue is only happening on Go 1.20 and is currently blocking Uber's upgrade to Go 1.20. |
This only affects non-unified IR IIRC, do you set |
Unfortunately yes, we have some codegen based tooling that's seeing huge build time regression due to almost 10x regression in calling gcexportdata.Read when we do not set that. |
Thanks for confirmation, I just worry there's another regression in Unified IR. Note that |
Will do. We do have plans to migrate that codegen toolchain not rely on gcexportdata before 1.21 is out but we'll get back to you soon with some repro and profile after further investigation. |
An even simpler repro:
|
Change https://go.dev/cl/466175 mentions this issue: |
This patch fixes a panic from incorrect interface conversion from *ir.BasicLit to *ir.ConstExpr. This only occurs when nounified GOEXPERIMENT is set, so ideally it should be backported to Go 1.20 and removed from master. Fixes golang#58339
This patch fixes a panic from incorrect interface conversion from *ir.BasicLit to *ir.ConstExpr. This only occurs when nounified GOEXPERIMENT is set, so ideally it should be backported to Go 1.20 and removed from master. Fixes golang#58339
This patch fixes a panic from incorrect interface conversion from *ir.BasicLit to *ir.ConstExpr. This only occurs when nounified GOEXPERIMENT is set, so ideally it should be backported to Go 1.20 and removed from master. Fixes golang#58339
This patch fixes a panic from incorrect interface conversion from *ir.BasicLit to *ir.ConstExpr. This only occurs when nounified GOEXPERIMENT is set, so ideally it should be backported to Go 1.20 and removed from master. Fixes golang#58339
This patch fixes a panic from incorrect interface conversion from *ir.BasicLit to *ir.ConstExpr. This only occurs when nounified GOEXPERIMENT is set, so ideally it should be backported to Go 1.20 and removed from master. Fixes golang#58339
Change https://go.dev/cl/466277 mentions this issue: |
Change https://go.dev/cl/467015 mentions this issue: |
Change https://go.dev/cl/467016 mentions this issue: |
There are a plenty of regression in 1.20 with this optimization. This CL disable inline static init, so it's safer to backport to 1.20 branch. The optimization will be enabled again during 1.21 cycle. Updates #58293 Updates #58339 For #58293 Change-Id: If5916008597b46146b4dc7108c6b389d53f35e95 Reviewed-on: https://go-review.googlesource.com/c/go/+/467015 Reviewed-by: Keith Randall <[email protected]> Reviewed-by: Keith Randall <[email protected]> Run-TryBot: Cuong Manh Le <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Reviewed-by: Matthew Dempsky <[email protected]> Auto-Submit: Cuong Manh Le <[email protected]>
CL https://go-review.googlesource.com/c/go/+/467035 is going to be backported, so I don't think we need to backport this one. |
This patch fixes a panic from incorrect interface conversion from *ir.BasicLit to *ir.ConstExpr. This only occurs when nounified GOEXPERIMENT is set, so ideally it should be backported to Go 1.20 and removed from master. Fixes golang#58339 Change-Id: I357069d7ee1707d5cc6811bd2fbdd7b0456323ae GitHub-Last-Rev: 641dedb GitHub-Pull-Request: golang#58389 Reviewed-on: https://go-review.googlesource.com/c/go/+/466175 Reviewed-by: Matthew Dempsky <[email protected]> Run-TryBot: Cuong Manh Le <[email protected]> Reviewed-by: Cuong Manh Le <[email protected]> Auto-Submit: Cuong Manh Le <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Reviewed-by: Robert Griesemer <[email protected]>
There are a plenty of regression in 1.20 with this optimization. This CL disable inline static init, so it's safer to backport to 1.20 branch. The optimization will be enabled again during 1.21 cycle. Updates golang#58293 Updates golang#58339 For golang#58293 Change-Id: If5916008597b46146b4dc7108c6b389d53f35e95 Reviewed-on: https://go-review.googlesource.com/c/go/+/467015 Reviewed-by: Keith Randall <[email protected]> Reviewed-by: Keith Randall <[email protected]> Run-TryBot: Cuong Manh Le <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Reviewed-by: Matthew Dempsky <[email protected]> Auto-Submit: Cuong Manh Le <[email protected]>
Static init inliner is using typecheck.EvalConst to handle string concatenation expressions. But static init inliner may reveal constant expressions after substitution, and the compiler needs to evaluate those expressions in non-constant semantic. Using typecheck.EvalConst, which always evaluates expressions in constant semantic, is not the right choice. For safety, this CL fold the logic to handle string concatenation to static init inliner, so there won't be regression in handling constant expressions in non-constant semantic. And also, future CL can simplify typecheck.EvalConst logic. Updates #58293 Updates #58339 Fixes #58439 Change-Id: I74068d99c245938e576afe9460cbd2b39677bbff Reviewed-on: https://go-review.googlesource.com/c/go/+/466277 Reviewed-by: Keith Randall <[email protected]> Run-TryBot: Cuong Manh Le <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Reviewed-by: David Chase <[email protected]> Reviewed-by: Keith Randall <[email protected]>
Updates #58293 Updates #58339 Fixes #58439 Change-Id: I06d2d92f86fa4a672d69515c4066d69d3e0fc75b Reviewed-on: https://go-review.googlesource.com/c/go/+/467016 TryBot-Result: Gopher Robot <[email protected]> Reviewed-by: Keith Randall <[email protected]> Reviewed-by: David Chase <[email protected]> Reviewed-by: Keith Randall <[email protected]> Run-TryBot: Cuong Manh Le <[email protected]>
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?
go.mod
:pkg/a.go
:b.go
:GOEXPERIMENT=nounified go1.20 build ./b.go
What did you expect to see?
Build successfully.
What did you see instead?
The text was updated successfully, but these errors were encountered: