Skip to content

cmd/compile: "internal compiler error: schedule does not include all values" on s390x #38916

Closed
@ALTree

Description

@ALTree
$ gotip version
go version devel +176481990f Thu May 7 07:06:11 2020 +0000 linux/amd64

This program:

package p

func f() {
	var b bool
	var c complex128
	_ = func(p complex128) complex128 {
		b = (p+1i == 0) && b
		return (p + 2i) * (p + 3i - c)
	}
}

Crashes the tip compiler, when built for s390x, with the following error:

$ GOARCH=s390x gotip build crash.go 

# command-line-arguments
./crash.go:7:19: internal compiler error: 'f.func1': schedule does not include all values in block b2

goroutine 9 [running]:
runtime/debug.Stack(0xd48b00, 0xc00000e018, 0x0)
	/home/alberto/go/src/runtime/debug/stack.go:24 +0x9f
cmd/compile/internal/gc.Fatalf(0xc00051a1c0, 0x36, 0xc0003461a0, 0x2, 0x2)
	/home/alberto/go/src/cmd/compile/internal/gc/subr.go:193 +0x1b0
cmd/compile/internal/gc.(*ssafn).Fatalf(0xc000065d10, 0x713000000002, 0xc61a63, 0x30, 0xc0005121d0, 0x1, 0x1)
	/home/alberto/go/src/cmd/compile/internal/gc/ssa.go:6839 +0x1a5
cmd/compile/internal/ssa.(*Func).Fatalf(...)
	/home/alberto/go/src/cmd/compile/internal/ssa/func.go:625
cmd/compile/internal/ssa.schedule(0xc0000b6840)
	/home/alberto/go/src/cmd/compile/internal/ssa/schedule.go:306 +0x1baa
cmd/compile/internal/ssa.Compile(0xc0000b6840)
	/home/alberto/go/src/cmd/compile/internal/ssa/compile.go:93 +0x9d1
cmd/compile/internal/gc.buildssa(0xc0000b6420, 0x1, 0x0)
	/home/alberto/go/src/cmd/compile/internal/gc/ssa.go:460 +0xd25
cmd/compile/internal/gc.compileSSA(0xc0000b6420, 0x1)
	/home/alberto/go/src/cmd/compile/internal/gc/pgen.go:296 +0x5d
cmd/compile/internal/gc.compileFunctions.func2(0xc000370a80, 0xc000014930, 0x1)
	/home/alberto/go/src/cmd/compile/internal/gc/pgen.go:361 +0x4d
created by cmd/compile/internal/gc.compileFunctions
	/home/alberto/go/src/cmd/compile/internal/gc/pgen.go:359 +0x129

It compiles fine on Go1.14.2.

The root cause may be similar to the one for #37246, but the reproducers in #37246 do not crash the 1.14.2 nor the tip compilers, while the program above does crash current tip.

cc @randall77 @mundaym @ruixin-bao

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.arch-s390xIssues solely affecting the s390x architecture.release-blocker

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions