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: internal compiler error: not lowered: v15, OffPtr PTR64 PTR64 on wasm #25741

Closed
ALTree opened this issue Jun 5, 2018 · 3 comments
Closed

Comments

@ALTree
Copy link
Member

@ALTree ALTree commented Jun 5, 2018

$ gotip version
go version devel +2c01b7d632 Tue Jun 5 16:49:07 2018 +0000 linux/amd64

The following program:

package p

func f() {
	var i int
	var s []string
	for true {
		i = -len("a")
		s[i] = ""
		s = []string{""}
	}
	_, _ = i, s
}

crashes the tip compiler when building for the wasm architecture:

$ GOARCH=wasm GOOS=js gotip build crash.go
# command-line-arguments
./crash.go:6:2: internal compiler error: not lowered: v15, OffPtr PTR64 PTR64

goroutine 10 [running]:
runtime/debug.Stack(0x0, 0x0, 0x0)
	/home/alberto/go/src/runtime/debug/stack.go:24 +0xa7
cmd/compile/internal/gc.Fatalf(0xc9d685, 0x2, 0xc000046d30, 0x1, 0x1)
	/home/alberto/go/src/cmd/compile/internal/gc/subr.go:182 +0x1f7
cmd/compile/internal/gc.(*ssafn).Fatalf(0xc00007b9e0, 0x602100000002, 0xc9d685, 0x2, 0xc000046d30, 0x1, 0x1)
	/home/alberto/go/src/cmd/compile/internal/gc/ssa.go:5540 +0x67
cmd/compile/internal/ssa.(*Func).Fatalf(0xc0003582c0, 0xc9d685, 0x2, 0xc000046d30, 0x1, 0x1)
	/home/alberto/go/src/cmd/compile/internal/ssa/func.go:562 +0x73
cmd/compile/internal/ssa.checkLower(0xc0003582c0)
	/home/alberto/go/src/cmd/compile/internal/ssa/lower.go:36 +0x34d
cmd/compile/internal/ssa.Compile(0xc0003582c0)
	/home/alberto/go/src/cmd/compile/internal/ssa/compile.go:70 +0x300
cmd/compile/internal/gc.buildssa(0xc000358000, 0x3, 0x0)
	/home/alberto/go/src/cmd/compile/internal/gc/ssa.go:210 +0xaa7
cmd/compile/internal/gc.compileSSA(0xc000358000, 0x3)
	/home/alberto/go/src/cmd/compile/internal/gc/pgen.go:259 +0x39
cmd/compile/internal/gc.compileFunctions.func2(0xc0004b8120, 0xc000012680, 0x3)
	/home/alberto/go/src/cmd/compile/internal/gc/pgen.go:323 +0x49
created by cmd/compile/internal/gc.compileFunctions
	/home/alberto/go/src/cmd/compile/internal/gc/pgen.go:321 +0x11a
@ALTree ALTree added this to the Go1.11 milestone Jun 5, 2018
@ALTree

This comment has been minimized.

Copy link
Member Author

@ALTree ALTree commented Jun 5, 2018

@cherrymui

This comment has been minimized.

Copy link
Contributor

@cherrymui cherrymui commented Jun 6, 2018

The offending value is OffPtr <*string> [-16] v14. Wasm.rules didn't handle negative offset.

@agnivade agnivade added the Arch-Wasm label Jun 6, 2018
@gopherbot

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Jun 6, 2018

Change https://golang.org/cl/116595 mentions this issue: cmd/compile: fix OffPtr with negative offset on wasm

@gopherbot gopherbot closed this in 88dc4ae Jun 6, 2018
@golang golang locked and limited conversation to collaborators Jun 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.