Skip to content

cmd/compile: compiler hangs on tiny program #25006

Closed
@ALTree

Description

@ALTree
$ gotip version
go version devel +d11df8baa8 Sun Apr 22 22:32:11 2018 +0000 linux/amd64

The following program:

package p

func spin() {
	var i int
	var b bool

	switch 1 {
	case 0:
		i = 1
	}
	switch 1 {
	case i:
	default:
		i = 1
		b = !b && (b && !b) && b
	}
	switch false {
	case false:
		i = 3 + -i
		switch 0 {
		case 1 - i:
		}
	}
}

hangs the tip compiler (spinning at 100% cpu) when built for amd64.

It compiles in no time in go1.10.

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