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: can't encode a NaN in AuxInt field #38359

Closed
ALTree opened this issue Apr 10, 2020 · 2 comments
Closed

cmd/compile: internal compiler error: can't encode a NaN in AuxInt field #38359

ALTree opened this issue Apr 10, 2020 · 2 comments
Assignees
Milestone

Comments

@ALTree
Copy link
Member

@ALTree ALTree commented Apr 10, 2020

$ gotip version
go version devel +782fcb44b9 Fri Apr 10 09:38:07 2020 +0000 linux/amd64

The following program:

package p

func f() {
	var st struct {
		f    float64
		_, _ string
	}

	f := 1e308
	st.f = 2*f - 2*f
}

crashes the tip compiler with this error:

$ gotip build crash.go

# command-line-arguments
./crash.go:11:1: internal compiler error: 'f': panic during opt while compiling f:

can't encode a NaN in AuxInt field

It compiles fine with Go 1.14.2.

@ALTree
Copy link
Member Author

@ALTree ALTree commented Apr 10, 2020

@randall77 randall77 self-assigned this Apr 10, 2020
@gopherbot
Copy link

@gopherbot gopherbot commented Apr 10, 2020

Change https://golang.org/cl/227860 mentions this issue: cmd/compile: prevent constant folding of +/- when result is NaN

@gopherbot gopherbot closed this in 83e288f Apr 10, 2020
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
3 participants
You can’t perform that action at this time.