Skip to content

cmd/compile: compiler hangs on tiny program #19783

Closed

Description

@ALTree

go version devel +371c83b594 Thu Mar 30 02:45:45 2017 +0000 linux/amd64

The following program:

package p

func Spin() {
l1:
	for true {
		goto l1
	l2:
		if true {
			goto l2
		}
	}
}

hangs the tip compiler (spinning at 100% cpu).

It compiles in no time in go1.8

Activity

  1. ALTree commented on Mar 30, 2017

    @ALTree
    MemberAuthor

    The issue was introduced in CL 37760 (cmd/compile: avoid generating some dead blocks).

    cc @josharian

  2. added this to the Go1.9 milestone on Mar 30, 2017
  3. josharian commented on Mar 30, 2017

    @josharian
    Contributor

    Thanks! I have a simple fix but it touches some very hot code, so benchmarking now.

  4. gopherbot commented on Mar 30, 2017

    @gopherbot
    Contributor

    CL https://golang.org/cl/38913 mentions this issue.

  5. locked and limited conversation to collaborators on Mar 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions