Skip to content

cmd/compile: internal compiler error after OpArg expansion delay on PPC64 #43551

Closed
@dmitshur

Description

@dmitshur

What version of Go are you using (go version)?

Tested with latest tip as of 30 minutes ago.

$ gotip version
go version devel +d2131704a Wed Jan 6 15:02:50 2021 +0000 darwin/amd64

Does this issue reproduce with the latest release?

No, this is a regression on tip.

What operating system and processor architecture are you using (go env)?

This happens on PPC64 but not AMD64.

What did you do?

I tried to build this minimized reproduce case.

go.mod

module m.test

p.go

package p // import "m.test"

import "m.test/x"

type S   x.S
type Key x.Key

func (s S) A() Key {
	return Key(x.S(s).A())
}

x/x.go

package x // import "m.test/x"

type S struct {
	a Key
}

func (s S) A() Key {
	return s.a
}

type Key struct {
	key int64
}

With:

GOOS=linux GOARCH=ppc64 gotip build

What did you expect to see?

Successful build, like with AMD64.

What did you see instead?

An internal compiler error:

$ GOOS=linux GOARCH=ppc64 gotip build
# m.test
./main.go:9:12: internal compiler error: 'S.A': not lowered: v12, Store SSA PTR STRUCT SSA

goroutine 49 [running]:
runtime/debug.Stack(0x19b87e0, 0xc0000ba008, 0x0)
	/Users/dmitshur/sdk/gotip/src/runtime/debug/stack.go:24 +0x9f
cmd/compile/internal/gc.Fatalf(0xc0003d3e30, 0x8, 0xc0003a0000, 0x2, 0x2)
	/Users/dmitshur/sdk/gotip/src/cmd/compile/internal/gc/subr.go:199 +0x1b0
cmd/compile/internal/gc.(*ssafn).Fatalf(0xc0000a1e30, 0x90c100000002, 0x1892753, 0x2, 0xc0000962a0, 0x1, 0x1)
	/Users/dmitshur/sdk/gotip/src/cmd/compile/internal/gc/ssa.go:7164 +0x1a5
cmd/compile/internal/ssa.(*Func).Fatalf(...)
	/Users/dmitshur/sdk/gotip/src/cmd/compile/internal/ssa/func.go:652
cmd/compile/internal/ssa.checkLower(0xc000124420)
	/Users/dmitshur/sdk/gotip/src/cmd/compile/internal/ssa/lower.go:36 +0x41a
cmd/compile/internal/ssa.Compile(0xc000124420)
	/Users/dmitshur/sdk/gotip/src/cmd/compile/internal/ssa/compile.go:96 +0x98d
cmd/compile/internal/gc.buildssa(0xc0001242c0, 0x0, 0x0)
	/Users/dmitshur/sdk/gotip/src/cmd/compile/internal/gc/ssa.go:470 +0x11ba
cmd/compile/internal/gc.compileSSA(0xc0001242c0, 0x0)
	/Users/dmitshur/sdk/gotip/src/cmd/compile/internal/gc/pgen.go:319 +0x5d
cmd/compile/internal/gc.compileFunctions.func2(0xc000710a20, 0xc0007120a0, 0x0)
	/Users/dmitshur/sdk/gotip/src/cmd/compile/internal/gc/pgen.go:384 +0x4d
created by cmd/compile/internal/gc.compileFunctions
	/Users/dmitshur/sdk/gotip/src/cmd/compile/internal/gc/pgen.go:382 +0x129

Bisection points to this regression being introduced in CL 262117.

CC @dr2chase.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions