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: internal compiler error: Value live at entry. It shouldn't be. [1.16 backport] #44358

Closed
gopherbot opened this issue Feb 18, 2021 · 4 comments

Comments

@gopherbot
Copy link

@gopherbot gopherbot commented Feb 18, 2021

@mdempsky requested issue #44355 to be considered for backport to the next 1.16 minor release.

@gopherbot please backport to Go 1.16

@mdempsky
Copy link
Member

@mdempsky mdempsky commented Feb 18, 2021

This is a compiler crash on valid code that used to work with Go 1.15.

@dmitshur dmitshur added this to the Go1.16.1 milestone Feb 19, 2021
@cagedmantis
Copy link
Contributor

@cagedmantis cagedmantis commented Feb 25, 2021

Approved. This is a serious issue.

@gopherbot
Copy link
Author

@gopherbot gopherbot commented Feb 25, 2021

Change https://golang.org/cl/296569 mentions this issue: [release-branch.go1.16] cmd/compile: declare inlined result params early for empty returns

@gopherbot
Copy link
Author

@gopherbot gopherbot commented Mar 1, 2021

Closed by merging ddeae6b to release-branch.go1.16.

@gopherbot gopherbot closed this Mar 1, 2021
gopherbot pushed a commit that referenced this issue Mar 1, 2021
…rly for empty returns

The code for delayed declaration of inlined result parameters only
handles non-empty return statements. This is generally okay, because
we already early declare if there are any (non-blank) named result
parameters.

But if a user writes a function with only blank result parameters and
with exactly one return statement, which is empty, then they could end
up hitting the dreaded "Value live at entry" ICE.

This CL fixes the issue by ensuring we always early declare inlined
result parameters if there are any empty return statements.

Fixes #44358.

Change-Id: I315f3853be436452883b1ce31da1bdffdf24d506
Reviewed-on: https://go-review.googlesource.com/c/go/+/293293
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Matthew Dempsky <mdempsky@google.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-on: https://go-review.googlesource.com/c/go/+/296569
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
4 participants