Skip to content

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

Closed

Description

@ALTree
$ 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.

Activity

  1. added
    NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.
    on Apr 10, 2020
  2. added this to the Go1.15 milestone on Apr 10, 2020
  3. ALTree commented on Apr 10, 2020

    @ALTree
    MemberAuthor
  4. self-assigned this
    on Apr 10, 2020
  5. gopherbot commented on Apr 10, 2020

    @gopherbot
    Contributor

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

  6. locked and limited conversation to collaborators on Apr 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.release-blocker

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions