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
Labels
arch-wasm WebAssembly issues 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 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 NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. release-blocker labels Jun 5, 2018
@ALTree ALTree added this to the Go1.11 milestone Jun 5, 2018
@ALTree
Copy link
Member Author

ALTree commented Jun 5, 2018

cc @neelance

@cherrymui
Copy link
Member

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

@agnivade agnivade added the arch-wasm WebAssembly issues label Jun 6, 2018
@gopherbot
Copy link
Contributor

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

@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.
Labels
arch-wasm WebAssembly issues 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