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: unexpected panic with -ssa=1 #16741

Closed
rakyll opened this issue Aug 16, 2016 · 8 comments
Closed

cmd/compile: unexpected panic with -ssa=1 #16741

rakyll opened this issue Aug 16, 2016 · 8 comments
Milestone

Comments

@rakyll
Copy link
Contributor

rakyll commented Aug 16, 2016

$ go version
go version devel +0958cd6 Mon Aug 15 23:24:31 2016 -0700 darwin/amd64

$ go build google.golang.org/grpc/transport
# google.golang.org/grpc/transport
../../../../google.golang.org/grpc/transport/http_util.go:248: internal compiler error: schedule does not include all values

goroutine 1 [running]:
runtime/debug.Stack(0x0, 0x0, 0x0)
    /Users/jbd/go/src/runtime/debug/stack.go:24 +0x79
cmd/compile/internal/gc.Fatalf(0x60abc5, 0x24, 0x0, 0x0, 0x0)
    /Users/jbd/go/src/cmd/compile/internal/gc/subr.go:165 +0x248
cmd/compile/internal/gc.(*ssaExport).Fatalf(0x8e20a8, 0xc400000a98, 0x60abc5, 0x24, 0x0, 0x0, 0x0)
    /Users/jbd/go/src/cmd/compile/internal/gc/ssa.go:4569 +0x74
cmd/compile/internal/ssa.(*Config).Fatalf(0xc421432000, 0xa98, 0x60abc5, 0x24, 0x0, 0x0, 0x0)
    /Users/jbd/go/src/cmd/compile/internal/ssa/config.go:271 +0x6e
cmd/compile/internal/ssa.(*Func).Fatalf(0xc4221f62d0, 0x60abc5, 0x24, 0x0, 0x0, 0x0)
    /Users/jbd/go/src/cmd/compile/internal/ssa/func.go:397 +0x6b
cmd/compile/internal/ssa.schedule(0xc4221f62d0)
    /Users/jbd/go/src/cmd/compile/internal/ssa/schedule.go:257 +0x11ef
cmd/compile/internal/ssa.Compile(0xc4221f62d0)
    /Users/jbd/go/src/cmd/compile/internal/ssa/compile.go:64 +0x323
cmd/compile/internal/gc.buildssa(0xc420d4eab0, 0x0)
    /Users/jbd/go/src/cmd/compile/internal/gc/ssa.go:235 +0xc5e
cmd/compile/internal/gc.compile(0xc420d4eab0)
    /Users/jbd/go/src/cmd/compile/internal/gc/pgen.go:405 +0x1370
cmd/compile/internal/gc.funccompile(0xc420d4eab0)
    /Users/jbd/go/src/cmd/compile/internal/gc/dcl.go:1287 +0x186
cmd/compile/internal/gc.Main()
    /Users/jbd/go/src/cmd/compile/internal/gc/main.go:465 +0x19ab
cmd/compile/internal/amd64.Main()
    /Users/jbd/go/src/cmd/compile/internal/amd64/galign.go:93 +0x2fa
main.main()
    /Users/jbd/go/src/cmd/compile/main.go:33 +0x2a3

Keeps compiling without SSA. We are not sure what might be wrong with the user code, hence assuming this might be a compiler bug.

@mdempsky
Copy link
Member

/cc @randall77 @josharian

@randall77
Copy link
Contributor

Small repro:

func div(d, r int64) int64 {
    if m := d % r; m > 0 {
        return d/r + 1
    }
    return d / r
}

@randall77
Copy link
Contributor

@cherrymui
Probably the special-case code in cse.go for Select{0,1}. Maybe when we move Selects to follow the tuple generator, we need to make sure we don't generate more than one of each of Select0 and Select1 at the new location.

@cherrymui
Copy link
Member

Yes, it looks like that. I'll take a look.

@randall77
Copy link
Contributor

As a workaround, you can do

func div(d, r int64) int64 {
    m, q := d%r, d/r
    if m > 0 {
        return q + 1
    }
    return q
}

@rakyll rakyll modified the milestones: Go1.8, Go1.7.1 Aug 16, 2016
@rakyll
Copy link
Contributor Author

rakyll commented Aug 16, 2016

Broken by a commit after the tree is open for 1.8 again. Moved it to the 1.8 milestone.

@gopherbot
Copy link

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

@gopherbot
Copy link

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

@golang golang locked and limited conversation to collaborators Aug 17, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants