Skip to content

cmd/compile: fi missing from LHS of fi, err := fs.FileInfo(~R0), ~R1 #45606

@nimelehin

Description

@nimelehin

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

$ go version
go version devel go1.17-0613c748e8 Fri Apr 16 14:15:49 2021 +0000 darwin/amd64

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

go env Output
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/nikitamelehin/Library/Caches/go-build"
GOENV="/Users/nikitamelehin/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/nikitamelehin/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/nikitamelehin/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/Users/nikitamelehin/Develop/Compiler/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/Users/nikitamelehin/Develop/Compiler/go/pkg/tool/darwin_amd64"
GOVCS=""
GOVERSION="devel go1.17-0613c748e8 Fri Apr 16 14:15:49 2021 +0000"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/nikitamelehin/Develop/Compiler/go/src/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/0m/jnt6wpss7x50v49qw84c29h40000gn/T/go-build2260580950=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

Compiled GO with increased inlineMaxBudged=229. This led to a inlining problem of function func isDir(path string) bool in src/cmd/go/internal/load/pkg.go.

func isDir(path string) bool {
	return isDirCache.Do(path, func() interface{} {
		fi, err := fsys.Stat(path)
		return err == nil && fi.IsDir()
	}).(bool)
}

What did you expect to see?

Successful compilation.

What did you see instead?

Got an error: pkg.go:559:5: internal compiler error: fi missing from LHS of fi, err := fs.FileInfo(~R0), ~R1

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.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions