Skip to content

Commit b9450dd

Browse files
committed
Merge remote-tracking branch 'upstream/master'
2 parents 59002b8 + 7a82b6a commit b9450dd

File tree

15 files changed

+179
-85
lines changed

15 files changed

+179
-85
lines changed

src/cmd/compile/internal/ssa/config.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,7 @@ func NewConfig(arch string, types Types, ctxt *obj.Link, optimize, softfloat boo
283283
c.FPReg = framepointerRegLOONG64
284284
c.LinkReg = linkRegLOONG64
285285
c.hasGReg = true
286+
c.unalignedOK = true
286287
case "s390x":
287288
c.PtrSize = 8
288289
c.RegSize = 8

src/cmd/compile/internal/ssagen/ssa.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ func buildssa(fn *ir.Func, worker int, isPgoHot bool) *ssa.Func {
317317
// optionally allows an ABI suffix specification in the GOSSAHASH, e.g. "(*Reader).Reset<0>" etc
318318
if strings.Contains(ssaDump, name) { // in all the cases the function name is entirely contained within the GOSSAFUNC string.
319319
nameOptABI := name
320-
if strings.Contains(ssaDump, ",") { // ABI specification
320+
if l := len(ssaDump); l > 1 && ssaDump[l-2] == ',' { // ABI specification
321321
nameOptABI = ssa.FuncNameABI(name, abiSelf.Which())
322322
} else if strings.HasSuffix(ssaDump, ">") { // if they use the linker syntax instead....
323323
l := len(ssaDump)

src/cmd/go/alldocs.go

Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/cmd/go/internal/cache/default.go

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -78,26 +78,27 @@ func DefaultDir() (string, bool, error) {
7878
// otherwise distinguish between an explicit "off" and a UserCacheDir error.
7979

8080
defaultDirOnce.Do(func() {
81-
defaultDir = cfg.Getenv("GOCACHE")
82-
if defaultDir != "" {
83-
defaultDirChanged = true
84-
if filepath.IsAbs(defaultDir) || defaultDir == "off" {
85-
return
86-
}
87-
defaultDir = "off"
88-
defaultDirErr = fmt.Errorf("GOCACHE is not an absolute path")
89-
return
90-
}
91-
9281
// Compute default location.
9382
dir, err := os.UserCacheDir()
9483
if err != nil {
9584
defaultDir = "off"
96-
defaultDirChanged = true
9785
defaultDirErr = fmt.Errorf("GOCACHE is not defined and %v", err)
86+
} else {
87+
defaultDir = filepath.Join(dir, "go-build")
88+
}
89+
90+
newDir := cfg.Getenv("GOCACHE")
91+
if newDir != "" {
92+
defaultDirErr = nil
93+
defaultDirChanged = newDir != defaultDir
94+
defaultDir = newDir
95+
if filepath.IsAbs(defaultDir) || defaultDir == "off" {
96+
return
97+
}
98+
defaultDir = "off"
99+
defaultDirErr = fmt.Errorf("GOCACHE is not an absolute path")
98100
return
99101
}
100-
defaultDir = filepath.Join(dir, "go-build")
101102
})
102103

103104
return defaultDir, defaultDirChanged, defaultDirErr

src/cmd/go/internal/modcmd/init.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@ must not already exist.
2222
2323
Init accepts one optional argument, the module path for the new module. If the
2424
module path argument is omitted, init will attempt to infer the module path
25-
using import comments in .go files, vendoring tool configuration files (like
26-
Gopkg.lock), and the current directory (if in GOPATH).
25+
using import comments in .go files and the current directory (if in GOPATH).
2726
2827
See https://golang.org/ref/mod#go-mod-init for more about 'go mod init'.
2928
`,

src/cmd/go/internal/modfetch/repo.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,7 @@ type RevInfo struct {
110110
// introduced, if a path p resolves using the pre-module "go get" lookup
111111
// to the root of a source code repository without a go.mod file,
112112
// that repository is treated as if it had a go.mod in its root directory
113-
// declaring module path p. (The go.mod is further considered to
114-
// contain requirements corresponding to any legacy version
115-
// tracking format such as Gopkg.lock, vendor/vendor.conf, and so on.)
113+
// declaring module path p.
116114
//
117115
// The presentation so far ignores the fact that a source code repository
118116
// has many different versions of a file tree, and those versions may

src/cmd/go/testdata/script/env_changed.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,11 @@ env GOROOT=./b
6767
go env -changed
6868
! stdout 'GOTOOLCHAIN=''?local''?'
6969

70+
[GOOS:windows] env LocalAppData=C:\
71+
[GOOS:windows] env GOCACHE=C:\go-build
72+
[GOOS:windows] go env -changed
73+
[GOOS:windows] ! stdout 'GOCACHE'
74+
7075
-- a/go.env --
7176
GOPROXY=s
7277
GOAMD64=v1

src/cmd/internal/sys/arch.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ var ArchLoong64 = &Arch{
144144
RegSize: 8,
145145
MinLC: 4,
146146
Alignment: 8, // Unaligned accesses are not guaranteed to be fast
147-
CanMergeLoads: false,
147+
CanMergeLoads: true,
148148
HasLR: true,
149149
FixedFrameSize: 8, // LR
150150
}

src/internal/poll/fd_windows.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,10 @@ func (fd *FD) initIO() error {
336336
return nil
337337
}
338338
fd.initIOOnce.Do(func() {
339+
if fd.closing() {
340+
// Closing, nothing to do.
341+
return
342+
}
339343
// The runtime poller will ignore I/O completion
340344
// notifications not initiated by this package,
341345
// so it is safe to add handles owned by the caller.
@@ -434,6 +438,12 @@ func (fd *FD) Close() error {
434438
if !fd.fdmu.increfAndClose() {
435439
return errClosing(fd.isFile)
436440
}
441+
// There is a potential race between a concurrent call to fd.initIO,
442+
// which calls fd.pd.init, and the call to fd.pd.evict below.
443+
// This is solved by calling fd.initIO ourselves, which will
444+
// block until the concurrent fd.initIO has completed. Note
445+
// that fd.initIO is no-op if first called from here.
446+
fd.initIO()
437447
if fd.kind == kindPipe {
438448
syscall.CancelIoEx(fd.Sysfd, nil)
439449
}

src/net/http/clone.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ func cloneMultipartForm(f *multipart.Form) *multipart.Form {
6868
Value: (map[string][]string)(Header(f.Value).Clone()),
6969
}
7070
if f.File != nil {
71-
m := make(map[string][]*multipart.FileHeader)
71+
m := make(map[string][]*multipart.FileHeader, len(f.File))
7272
for k, vv := range f.File {
7373
vv2 := make([]*multipart.FileHeader, len(vv))
7474
for i, v := range vv {

0 commit comments

Comments
 (0)