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: compiler hangs on tiny program #25006

Closed
ALTree opened this issue Apr 23, 2018 · 5 comments
Closed

cmd/compile: compiler hangs on tiny program #25006

ALTree opened this issue Apr 23, 2018 · 5 comments
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. release-blocker
Milestone

Comments

@ALTree
Copy link
Member

ALTree commented Apr 23, 2018

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

@ALTree ALTree added NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. release-blocker labels Apr 23, 2018
@ALTree ALTree added this to the Go1.11 milestone Apr 23, 2018
@ALTree
Copy link
Member Author

ALTree commented Apr 23, 2018

The issue was introduced in CL 100935 (cmd/compile: implement CMOV on amd64).

cc @rasky @randall77

@TocarIP
Copy link
Contributor

TocarIP commented Apr 23, 2018

Looks like an endless loop in rules application. Will send fix soon

@gopherbot
Copy link

Change https://golang.org/cl/108879 mentions this issue: cmd/compile/internal/ssa: fix endless compile loop on AMD64

@TocarIP
Copy link
Contributor

TocarIP commented Apr 23, 2018

Looks like it is easy to introduce endless rewrite, maybe we should just stop rewrite after e. g. 1000*values rewrites and suggest opening a bug.

@rasky
Copy link
Member

rasky commented Apr 25, 2018

Thanks @TocarIP for cleaning up after me!

@golang golang locked and limited conversation to collaborators Apr 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. release-blocker
Projects
None yet
Development

No branches or pull requests

4 participants