Skip to content

Commit

Permalink
[dev.link] all: merge branch 'master' into dev.link
Browse files Browse the repository at this point in the history
NOT apply CL 238779, which is for sym.Symbols.

Clean merge other than that.

Change-Id: I535e9580fcf7d6f382bd684c3d53f11f90d0b6ed
  • Loading branch information
cherrymui committed Jun 19, 2020
2 parents d1a186d + f2bba30 commit 5e526e6
Show file tree
Hide file tree
Showing 70 changed files with 2,188 additions and 3,028 deletions.
3 changes: 2 additions & 1 deletion AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -934,7 +934,7 @@ Maya Rashish <[email protected]>
Mayank Kumar <[email protected]>
MediaMath, Inc
Meir Fischer <[email protected]>
Meng Zhuo <[email protected]>
Meng Zhuo <[email protected]> <[email protected]>
Meteor Development Group
Mhd Sulhan <[email protected]>
Micah Stetson <[email protected]>
Expand Down Expand Up @@ -1044,6 +1044,7 @@ Niels Widger <[email protected]>
Nigel Kerr <[email protected]>
Nik Nyby <[email protected]>
Nikhil Benesch <[email protected]>
Nikita Gillmann <[email protected]> <[email protected]>
Niklas Schnelle <[email protected]>
Niko Dziemba <[email protected]>
Nikolay Turpitko <[email protected]>
Expand Down
3 changes: 2 additions & 1 deletion CONTRIBUTORS
Original file line number Diff line number Diff line change
Expand Up @@ -1501,7 +1501,7 @@ Maxwell Krohn <[email protected]>
Maya Rashish <[email protected]>
Mayank Kumar <[email protected]>
Meir Fischer <[email protected]>
Meng Zhuo <[email protected]>
Meng Zhuo <[email protected]> <[email protected]>
Mhd Sulhan <[email protected]>
Micah Stetson <[email protected]>
Michael Anthony Knyszek <[email protected]>
Expand Down Expand Up @@ -1654,6 +1654,7 @@ Nigel Kerr <[email protected]>
Nigel Tao <[email protected]>
Nik Nyby <[email protected]>
Nikhil Benesch <[email protected]>
Nikita Gillmann <[email protected]> <[email protected]>
Nikita Kryuchkov <[email protected]>
Nikita Vanyasin <[email protected]>
Niklas Schnelle <[email protected]>
Expand Down
25 changes: 10 additions & 15 deletions doc/gccgo_install.html
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,13 @@ <h2 id="Releases">Releases</h2>
<h2 id="Source_code">Source code</h2>

<p>
If you cannot use a release, or prefer to build gccgo for
yourself,
the gccgo source code is accessible via Subversion. The
GCC web site
has <a href="https://gcc.gnu.org/svn.html">instructions for getting the
GCC source code</a>. The gccgo source code is included. As a
convenience, a stable version of the Go support is available in
a branch of the main GCC code
repository: <code>svn:https://gcc.gnu.org/svn/gcc/branches/gccgo</code>.
If you cannot use a release, or prefer to build gccgo for yourself, the
gccgo source code is accessible via Git. The GCC web site has
<a href="https://gcc.gnu.org/git.html">instructions for getting the GCC
source code</a>. The gccgo source code is included. As a convenience, a
stable version of the Go support is available in the
<code>devel/gccgo</code> branch of the main GCC code repository:
<code>git:https://gcc.gnu.org/git/gcc.git</code>.
This branch is periodically updated with stable Go compiler sources.
</p>

Expand Down Expand Up @@ -139,13 +137,10 @@ <h3 id="Gold">Gold</h3>
</p>

<pre>
cvs -z 9 -d :pserver:[email protected]:/cvs/src login
[password is "anoncvs"]
[The next command will create a directory named src, not binutils]
cvs -z 9 -d :pserver:[email protected]:/cvs/src co binutils
git clone git:https://sourceware.org/git/binutils-gdb.git
mkdir binutils-objdir
cd binutils-objdir
../src/configure --enable-gold=default --prefix=/opt/gold
../binutils-gdb/configure --enable-gold=default --prefix=/opt/gold
make
make install
</pre>
Expand Down Expand Up @@ -176,7 +171,7 @@ <h3 id="Build_commands">Build commands</h3>
</p>

<pre>
svn checkout svn:https://gcc.gnu.org/svn/gcc/branches/gccgo gccgo
git clone --branch devel/gccgo git:https://gcc.gnu.org/git/gcc.git gccgo
mkdir objdir
cd objdir
../gccgo/configure --prefix=/opt/gccgo --enable-languages=c,c++,go --with-ld=/opt/gold/bin/ld
Expand Down
100 changes: 77 additions & 23 deletions doc/go1.15.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ <h3 id="darwin">Darwin</h3>
<h3 id="windows">Windows</h3>

<p> <!-- CL 214397 and CL 230217 -->
Go 1.15 now generates Windows ASLR executables when -buildmode=pie
cmd/link flag is provided. Go command uses -buildmode=pie by default
Go 1.15 now generates Windows ASLR executables when <code>-buildmode=pie</code>
cmd/link flag is provided. Go command uses <code>-buildmode=pie</code> by default
on Windows.
</p>

Expand Down Expand Up @@ -145,7 +145,7 @@ <h4 id="module-cache">Module cache</h4>
<a href="https://golang.org/issue/36568">issue #36568</a>). The workaround is
not enabled by default because it is not safe to use when Go versions lower
than 1.14.2 and 1.13.10 are running concurrently with the same module cache.
It can be enabled by explictly setting the environment variable
It can be enabled by explicitly setting the environment variable
<code>GODEBUG=modcacheunzipinplace=1</code>.
</p>

Expand Down Expand Up @@ -313,7 +313,8 @@ <h2 id="linker">Linker</h2>
<p>
For a representative set of large Go programs, linking is 20% faster
and requires 30% less memory on average, for <code>ELF</code>-based
OSes running on <code>amd64</code> architectures, with more modest
OSes (Linux, FreeBSD, NetBSD, OpenBSD, Dragonfly, and Solaris)
running on <code>amd64</code> architectures, with more modest
improvements for other architecture/OS combinations.
</p>

Expand Down Expand Up @@ -359,11 +360,11 @@ <h3 id="time/tzdata">New embedded tzdata package</h3>
<h3 id="cgo">Cgo</h3>

<p><!-- CL 235817 -->
Go 1.15 will translate the C type <code>EGLConfig</code> to the
Go type <code>uintptr</code>. This change is similar to how Go
1.12 and newer treats <code>EGLDisplay</code>, Darwin's CoreFoundation and
Java's JNI types. See the <a href="/cmd/cgo/#hdr-Special_cases">cgo
documentation</a> for more information.
Go 1.15 will translate the C type <code>EGLConfig</code> to the
Go type <code>uintptr</code>. This change is similar to how Go
1.12 and newer treats <code>EGLDisplay</code>, Darwin's CoreFoundation and
Java's JNI types. See the <a href="/cmd/cgo/#hdr-Special_cases">cgo
documentation</a> for more information.
</p>

<h3 id="minor_library_changes">Minor changes to the library</h3>
Expand All @@ -374,24 +375,27 @@ <h3 id="minor_library_changes">Minor changes to the library</h3>
in mind.
</p>

<dl id="debug/pe"><dt><a href="/pkg/debug/pe/">debug/pe</a></dt>
<dl id="bufio"><dt><a href="/pkg/bufio/">bufio</a></dt>
<dd>
<p><!-- CL 222637 -->
The package now defines the
<code>IMAGE_FILE</code>, <code>IMAGE_SUBSYSTEM</code>,
and <code>IMAGE_DLLCHARACTERISTICS</code> constants used by the
PE file format.
<p><!-- CL 225357, CL 225557 -->
When a <a href="/pkg/bufio/#Scanner"><code>Scanner</code></a> is
used with an invalid
<a href="/pkg/io/#Reader"><code>io.Reader</code></a> that
incorrectly returns a negative number from <code>Read</code>,
the <code>Scanner</code> will no longer panic, but will instead
return the new error
<a href="/pkg/bufio/#ErrBadReadCount"><code>ErrBadReadCount</code></a>.
</p>
</dd>
</dl><!-- debug/pe -->
</dl><!-- bufio -->

<dl id="crypto"><dt><a href="/pkg/crypto/">crypto</a></dt>
<dd>
<p><!-- CL 231417, CL 225460 -->
The <code>PrivateKey</code> and <code>PublicKey</code> types in the
<a href="/pkg/crypto/rsa"><code>crypto/rsa</code></a>,
<a href="/pkg/crypto/ecdsa"><code>crypto/ecdsa</code></a>, and
<a href="/pkg/crypto/ed25519"><code>crypto/ed25519</code></a> packages
<a href="/pkg/crypto/rsa/"><code>crypto/rsa</code></a>,
<a href="/pkg/crypto/ecdsa/"><code>crypto/ecdsa</code></a>, and
<a href="/pkg/crypto/ed25519/"><code>crypto/ed25519</code></a> packages
now have an <code>Equal</code> method to compare keys for equivalence
or to make type-safe interfaces for public keys. The method signature
is compatible with
Expand Down Expand Up @@ -551,6 +555,46 @@ <h3 id="minor_library_changes">Minor changes to the library</h3>
</dd>
</dl><!-- crypto/x509/pkix -->

<dl id="database/sql"><dt><a href="/pkg/database/sql/">database/sql</a></dt>
<dd>
<p><!-- CL 145758 -->
The new <a href="/pkg/database/sql/#DB.SetConnMaxIdleTime"><code>DB.SetConnMaxIdleTime</code></a>
method allows removing a connection from the connection pool after
it has been idle for a period of time, without regard to the total
lifespan of the connection. The <a href="/pkg/database/sql/#DBStats.MaxIdleTimeClosed"><code>DBStats.MaxIdleTimeClosed</code></a>
field shows the total number of connections closed due to
<code>DB.SetConnMaxIdleTime</code>.
</p>

<p><!-- CL 214317 -->
The new <a href="/pkg/database/sql/#Row.Err"><code>Row.Err</code></a> getter
allows checking for query errors without calling
<code>Row.Scan</code>.
</p>
</dd>
</dl><!-- database/sql -->

<dl id="database/sql/driver"><dt><a href="/pkg/database/sql/driver/">database/sql/driver</a></dt>
<dd>
<p><!-- CL 174122 -->
The new <a href="/pkg/database/sql/driver/#Validator"><code>Validator</code></a>
interface may be implemented by <code>Conn</code> to allow drivers
to signal if a connection is valid or if it should be discarded.
</p>
</dd>
</dl><!-- database/sql/driver -->

<dl id="debug/pe"><dt><a href="/pkg/debug/pe/">debug/pe</a></dt>
<dd>
<p><!-- CL 222637 -->
The package now defines the
<code>IMAGE_FILE</code>, <code>IMAGE_SUBSYSTEM</code>,
and <code>IMAGE_DLLCHARACTERISTICS</code> constants used by the
PE file format.
</p>
</dd>
</dl><!-- debug/pe -->

<dl id="encoding/json"><dt><a href="/pkg/encoding/json/">encoding/json</a></dt>
<dd>
<p><!-- CL 191783 -->
Expand Down Expand Up @@ -604,6 +648,16 @@ <h3 id="minor_library_changes">Minor changes to the library</h3>
</dd>
</dl><!-- fmt -->

<dl id="go/printer"><dt><a href="/pkg/go/printer/">go/printer</a></dt>
<dd>
<p><!-- CL 231461 -->
The new <a href="/pkg/go/printer/#Mode"><code>Mode</code></a>
value <a href="/pkg/go/printer/#StdFormat"><code>StdFormat</code></a>
directs the printer to apply standard formatting changes while
printing the output.
</dd>
</dl><!-- go/printer -->

<dl id="io/ioutil"><dt><a href="/pkg/io/ioutil/">io/ioutil</a></dt>
<dd>
<p><!-- CL 212597 -->
Expand Down Expand Up @@ -633,7 +687,7 @@ <h3 id="minor_library_changes">Minor changes to the library</h3>
<code>Conn.SetReadDeadline</code>,
or <code>Conn.SetWriteDeadline</code> methods, it will now
return an error that is or wraps
<a href="/pkg/os#ErrDeadlineExceeded"><code>os.ErrDeadlineExceeded</code></a>.
<a href="/pkg/os/#ErrDeadlineExceeded"><code>os.ErrDeadlineExceeded</code></a>.
This may be used to reliably detect whether an error is due to
an exceeded deadline.
Earlier releases recommended calling the <code>Timeout</code>
Expand Down Expand Up @@ -712,7 +766,7 @@ <h3 id="minor_library_changes">Minor changes to the library</h3>
<a href="/pkg/os/#File.SetReadDeadline"><code>File.SetReadDeadline</code></a>,
or <a href="/pkg/os/#File.SetWriteDeadline"><code>File.SetWriteDeadline</code></a>
methods, it will now return an error that is or wraps
<a href="/pkg/os#ErrDeadlineExceeded"><code>os.ErrDeadlineExceeded</code></a>.
<a href="/pkg/os/#ErrDeadlineExceeded"><code>os.ErrDeadlineExceeded</code></a>.
This may be used to reliably detect whether an error is due to
an exceeded deadline.
Earlier releases recommended calling the <code>Timeout</code>
Expand Down Expand Up @@ -778,7 +832,7 @@ <h3 id="minor_library_changes">Minor changes to the library</h3>
</dd>
</dl>

<dl id="pkg-runtime-pprof"><dt><a href="/pkg/runtime/pprof">runtime/pprof</a></dt>
<dl id="pkg-runtime-pprof"><dt><a href="/pkg/runtime/pprof/">runtime/pprof</a></dt>
<dd>
<p><!-- CL 189318 -->
The goroutine profile includes the profile labels associated with each goroutine
Expand All @@ -797,7 +851,7 @@ <h3 id="minor_library_changes">Minor changes to the library</h3>
<a href="/pkg/strconv/#FormatComplex"><code>FormatComplex</code></a> converts a complex number into a string of the form (a+bi), where a and b are the real and imaginary parts.
</p>
<p>
<a href="/pkg/strconv/#ParseComplex"><code>ParseComplex</code></a> converts a string into a complex number of a specificed precision. <code>ParseComplex</code> accepts complex numbers in the format <code>N+Ni</code>.
<a href="/pkg/strconv/#ParseComplex"><code>ParseComplex</code></a> converts a string into a complex number of a specified precision. <code>ParseComplex</code> accepts complex numbers in the format <code>N+Ni</code>.
</p>
</dd>
</dl><!-- strconv -->
Expand Down
12 changes: 12 additions & 0 deletions misc/cgo/testgodefs/testdata/issue39534.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// Copyright 2020 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//
// +build ignore

package main

// enum { ENUMVAL = 0x1 };
import "C"

const ENUMVAL = C.ENUMVAL
1 change: 1 addition & 0 deletions misc/cgo/testgodefs/testgodefs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ var filePrefixes = []string{
"issue37479",
"issue37621",
"issue38649",
"issue39534",
}

func TestGoDefs(t *testing.T) {
Expand Down
14 changes: 8 additions & 6 deletions src/bufio/scan_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -558,8 +558,8 @@ func (r *negativeEOFReader) Read(p []byte) (int, error) {
return -1, io.EOF
}

// Test that the scanner doesn't panic on a reader that returns a
// negative count of bytes read (issue 38053).
// Test that the scanner doesn't panic and returns ErrBadReadCount
// on a reader that returns a negative count of bytes read (issue 38053).
func TestNegativeEOFReader(t *testing.T) {
r := negativeEOFReader(10)
scanner := NewScanner(&r)
Expand All @@ -571,8 +571,8 @@ func TestNegativeEOFReader(t *testing.T) {
break
}
}
if scanner.Err() == nil {
t.Error("scanner.Err returned nil, expected an error")
if got, want := scanner.Err(), ErrBadReadCount; got != want {
t.Errorf("scanner.Err: got %v, want %v", got, want)
}
}

Expand All @@ -584,11 +584,13 @@ func (largeReader) Read(p []byte) (int, error) {
return len(p) + 1, nil
}

// Test that the scanner doesn't panic and returns ErrBadReadCount
// on a reader that returns an impossibly large count of bytes read (issue 38053).
func TestLargeReader(t *testing.T) {
scanner := NewScanner(largeReader{})
for scanner.Scan() {
}
if scanner.Err() == nil {
t.Error("scanner.Err returned nil, expected an error")
if got, want := scanner.Err(), ErrBadReadCount; got != want {
t.Errorf("scanner.Err: got %v, want %v", got, want)
}
}
2 changes: 1 addition & 1 deletion src/cmd/cgo/gcc.go
Original file line number Diff line number Diff line change
Expand Up @@ -1354,7 +1354,7 @@ func (p *Package) rewriteRef(f *File) {

if *godefs {
// Substitute definition for mangled type name.
if r.Name.Type != nil {
if r.Name.Type != nil && r.Name.Kind == "type" {
expr = r.Name.Type.Go
}
if id, ok := expr.(*ast.Ident); ok {
Expand Down
1 change: 1 addition & 0 deletions src/cmd/compile/fmtmap_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ var knownFormats = map[string]string{
"cmd/compile/internal/ssa.Sym %v": "",
"cmd/compile/internal/ssa.ValAndOff %s": "",
"cmd/compile/internal/ssa.domain %v": "",
"cmd/compile/internal/ssa.flagConstant %s": "",
"cmd/compile/internal/ssa.posetNode %v": "",
"cmd/compile/internal/ssa.posetTestOp %v": "",
"cmd/compile/internal/ssa.rbrank %d": "",
Expand Down
8 changes: 2 additions & 6 deletions src/cmd/compile/internal/arm/ssa.go
Original file line number Diff line number Diff line change
Expand Up @@ -857,12 +857,8 @@ func ssaGenValue(s *gc.SSAGenState, v *ssa.Value) {
p := s.Prog(obj.AGETCALLERPC)
p.To.Type = obj.TYPE_REG
p.To.Reg = v.Reg()
case ssa.OpARMFlagEQ,
ssa.OpARMFlagLT_ULT,
ssa.OpARMFlagLT_UGT,
ssa.OpARMFlagGT_ULT,
ssa.OpARMFlagGT_UGT:
v.Fatalf("Flag* ops should never make it to codegen %v", v.LongString())
case ssa.OpARMFlagConstant:
v.Fatalf("FlagConstant op should never make it to codegen %v", v.LongString())
case ssa.OpARMInvertFlags:
v.Fatalf("InvertFlags should never make it to codegen %v", v.LongString())
case ssa.OpClobber:
Expand Down
8 changes: 2 additions & 6 deletions src/cmd/compile/internal/arm64/ssa.go
Original file line number Diff line number Diff line change
Expand Up @@ -943,12 +943,8 @@ func ssaGenValue(s *gc.SSAGenState, v *ssa.Value) {
p := s.Prog(obj.AGETCALLERPC)
p.To.Type = obj.TYPE_REG
p.To.Reg = v.Reg()
case ssa.OpARM64FlagEQ,
ssa.OpARM64FlagLT_ULT,
ssa.OpARM64FlagLT_UGT,
ssa.OpARM64FlagGT_ULT,
ssa.OpARM64FlagGT_UGT:
v.Fatalf("Flag* ops should never make it to codegen %v", v.LongString())
case ssa.OpARM64FlagConstant:
v.Fatalf("FlagConstant op should never make it to codegen %v", v.LongString())
case ssa.OpARM64InvertFlags:
v.Fatalf("InvertFlags should never make it to codegen %v", v.LongString())
case ssa.OpClobber:
Expand Down
Loading

0 comments on commit 5e526e6

Please sign in to comment.