]> Cypherpunks repositories - gostls13.git/log
gostls13.git
12 years agocmd/5g, cmd/6g: fix out of registers with array indexing.
Rémy Oudompheng [Fri, 2 Nov 2012 06:50:59 +0000 (07:50 +0100)]
cmd/5g, cmd/6g: fix out of registers with array indexing.

Compiling expressions like:
    s[s[s[s[s[s[s[s[s[s[s[s[i]]]]]]]]]]]]
make 5g and 6g run out of registers. Such expressions can arise
if a slice is used to represent a permutation and the user wants
to iterate it.

This is due to the usual problem of allocating registers before
going down the expression tree, instead of allocating them in a
postfix way.

The functions cgenr and agenr (that generate a value to a newly
allocated register instead of an existing location), are either
introduced or modified when they already existed to allocate
the new register as late as possible, and sudoaddable is disabled
for OINDEX nodes so that igen/agenr is used instead.

Update #4207.

R=dave, daniel.morsing, rsc
CC=golang-dev
https://golang.org/cl/6733055

12 years agoimage/png: update palette out-of-bounds comment.
Nigel Tao [Fri, 2 Nov 2012 06:20:19 +0000 (17:20 +1100)]
image/png: update palette out-of-bounds comment.

R=r
CC=golang-dev
https://golang.org/cl/6817070

12 years agospec: we're now at Unicode 6.2.0
Oling Cat [Fri, 2 Nov 2012 05:57:01 +0000 (22:57 -0700)]
spec: we're now at Unicode 6.2.0

R=golang-dev
CC=golang-dev
https://golang.org/cl/6818083

12 years agocmd/gc, cmd/ld: struct field tracking
Russ Cox [Fri, 2 Nov 2012 04:17:21 +0000 (00:17 -0400)]
cmd/gc, cmd/ld: struct field tracking

This is an experiment in static analysis of Go programs
to understand which struct fields a program might use.
It is not part of the Go language specification, it must
be enabled explicitly when building the toolchain,
and it may be removed at any time.

After building the toolchain with GOEXPERIMENT=fieldtrack,
a specific field can be marked for tracking by including
`go:"track"` in the field tag:

        package pkg

        type T struct {
                F int `go:"track"`
                G int // untracked
        }

To simplify usage, only named struct types can have
tracked fields, and only exported fields can be tracked.

The implementation works by making each function begin
with a sequence of no-op USEFIELD instructions declaring
which tracked fields are accessed by a specific function.
After the linker's dead code elimination removes unused
functions, the fields referred to by the remaining
USEFIELD instructions are the ones reported as used by
the binary.

The -k option to the linker specifies the fully qualified
symbol name (such as my/pkg.list) of a string variable that
should be initialized with the field tracking information
for the program. The field tracking string is a sequence
of lines, each terminated by a \n and describing a single
tracked field referred to by the program. Each line is made
up of one or more tab-separated fields. The first field is
the name of the tracked field, fully qualified, as in
"my/pkg.T.F". Subsequent fields give a shortest path of
reverse references from that field to a global variable or
function, corresponding to one way in which the program
might reach that field.

A common source of false positives in field tracking is
types with large method sets, because a reference to the
type descriptor carries with it references to all methods.
To address this problem, the CL also introduces a comment
annotation

        //go:nointerface

that marks an upcoming method declaration as unavailable
for use in satisfying interfaces, both statically and
dynamically. Such a method is also invisible to package
reflect.

Again, all of this is disabled by default. It only turns on
if you have GOEXPERIMENT=fieldtrack set during make.bash.

R=iant, ken
CC=golang-dev
https://golang.org/cl/6749064

12 years agonet: use better error messages on windows
Alex Brainman [Fri, 2 Nov 2012 00:07:22 +0000 (11:07 +1100)]
net: use better error messages on windows

Fixes #4320.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6810064

12 years agogo/ast: document use of Data field for method objects
Robert Griesemer [Thu, 1 Nov 2012 23:27:43 +0000 (16:27 -0700)]
go/ast: document use of Data field for method objects

R=iant
CC=golang-dev
https://golang.org/cl/6775093

12 years agoexp/types: move exp/types/staging -> exp/types
Robert Griesemer [Thu, 1 Nov 2012 22:38:17 +0000 (15:38 -0700)]
exp/types: move exp/types/staging -> exp/types

- removes exp/types/staging
- the only code change is in exp/gotype/gotype.go

R=iant
CC=golang-dev
https://golang.org/cl/6822068

12 years agoexp/types, exp/gotype: remove exp/types
Robert Griesemer [Thu, 1 Nov 2012 22:25:51 +0000 (15:25 -0700)]
exp/types, exp/gotype: remove exp/types

The only code change is in exp/gotype/gotype.go.
The latest reviewed version of exp/types is now
exp/types/staging.

First step toward replacing exp/types with
exp/types/staging.

R=iant
CC=golang-dev
https://golang.org/cl/6819071

12 years agomisc/cgo/test: changes to pass when using gccgo
Ian Lance Taylor [Thu, 1 Nov 2012 20:54:09 +0000 (13:54 -0700)]
misc/cgo/test: changes to pass when using gccgo

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6821067

12 years agocrypto: use better hash benchmarks
Eric Roshan-Eisner [Thu, 1 Nov 2012 20:21:18 +0000 (16:21 -0400)]
crypto: use better hash benchmarks

Labels the existing benchmark as stream, and add benchmarks that
compute the checksum.

R=golang-dev, agl
CC=golang-dev
https://golang.org/cl/6814060

12 years agonet: fix race in TestReadWriteDeadline.
Rémy Oudompheng [Thu, 1 Nov 2012 19:52:30 +0000 (20:52 +0100)]
net: fix race in TestReadWriteDeadline.

Discovered by adding OBLOCK support to race
instrumentation.

R=golang-dev, minux.ma, rsc
CC=golang-dev
https://golang.org/cl/6819067

12 years agoencoding/binary: skip blank fields when (en/de)coding structs
Robert Griesemer [Thu, 1 Nov 2012 19:39:20 +0000 (12:39 -0700)]
encoding/binary: skip blank fields when (en/de)coding structs

- minor unrelated cleanups
- performance impact in the noise

benchmark                       old ns/op    new ns/op    delta
BenchmarkReadSlice1000Int32s        83462        83346   -0.14%
BenchmarkReadStruct                  4141         4247   +2.56%
BenchmarkReadInts                    1588         1586   -0.13%
BenchmarkWriteInts                   1550         1489   -3.94%
BenchmarkPutUvarint32                  39           39   +1.02%
BenchmarkPutUvarint64                 142          144   +1.41%

benchmark                        old MB/s     new MB/s  speedup
BenchmarkReadSlice1000Int32s        47.93        47.99    1.00x
BenchmarkReadStruct                 16.90        16.48    0.98x
BenchmarkReadInts                   18.89        18.91    1.00x
BenchmarkWriteInts                  19.35        20.15    1.04x
BenchmarkPutUvarint32              101.90       100.82    0.99x
BenchmarkPutUvarint64               56.11        55.45    0.99x

Fixes #4185.

R=r, rsc
CC=golang-dev
https://golang.org/cl/6750053

12 years agobuild: do not run race tests with cgo disabled
Russ Cox [Thu, 1 Nov 2012 19:13:00 +0000 (15:13 -0400)]
build: do not run race tests with cgo disabled

R=dvyukov
CC=golang-dev
https://golang.org/cl/6810067

12 years agocmd/gc: fix build
Dmitriy Vyukov [Thu, 1 Nov 2012 18:59:53 +0000 (22:59 +0400)]
cmd/gc: fix build

R=golang-dev
CC=golang-dev
https://golang.org/cl/6826047

12 years agocmd/gc: racewalk: fix a bunch of minor issues
Dmitriy Vyukov [Thu, 1 Nov 2012 18:56:04 +0000 (22:56 +0400)]
cmd/gc: racewalk: fix a bunch of minor issues
1. Prepend racefuncenter() to fn->enter -- fn->enter can contain new() calls,
and we want them to be in the scope of the function.
2. Dump fn->enter and fn->exit.
3. Add TODO that OTYPESW expression can contain interesting memory accesses.
4. Ignore only _ names instead of all names starting with _.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6822048

12 years agosyscall: add {Get,Set,List,Remove}xattr on Linux.
Han-Wen Nienhuys [Thu, 1 Nov 2012 18:49:38 +0000 (14:49 -0400)]
syscall: add {Get,Set,List,Remove}xattr on Linux.

R=golang-dev, minux.ma, fullung, dave, rsc, hanwenn
CC=golang-dev
https://golang.org/cl/6350074

12 years agocmd/gc, runtime: pass PC directly to racefuncenter.
Rémy Oudompheng [Thu, 1 Nov 2012 18:43:29 +0000 (19:43 +0100)]
cmd/gc, runtime: pass PC directly to racefuncenter.

go test -race -run none -bench . encoding/json
benchmark                      old ns/op    new ns/op    delta
BenchmarkCodeEncoder          3207689000   1716149000  -46.50%
BenchmarkCodeMarshal          3206761000   1715677000  -46.50%
BenchmarkCodeDecoder          8647304000   4482709000  -48.16%
BenchmarkCodeUnmarshal        8032217000   3451248000  -57.03%
BenchmarkCodeUnmarshalReuse   8016722000   3480502000  -56.58%
BenchmarkSkipValue           10340453000   4560313000  -55.90%

benchmark                       old MB/s     new MB/s  speedup
BenchmarkCodeEncoder                0.60         1.13    1.88x
BenchmarkCodeMarshal                0.61         1.13    1.85x
BenchmarkCodeDecoder                0.22         0.43    1.95x
BenchmarkCodeUnmarshal              0.24         0.56    2.33x
BenchmarkCodeUnmarshalReuse         0.24         0.56    2.33x
BenchmarkSkipValue                  0.19         0.44    2.32x

Fixes #4248.

R=dvyukov, golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6815066

12 years agoexp/types/staging: filling in more blanks
Robert Griesemer [Thu, 1 Nov 2012 18:23:27 +0000 (11:23 -0700)]
exp/types/staging: filling in more blanks

- simplified assignment checking by removing duplicate code
- implemented field lookup (methods, structs, embedded fields)
- importing methods (not just parsing them)
- type-checking functions and methods
- typechecking more statements (inc/dec, select, return)
- tracing support for easier debugging
- handling nil more correctly (comparisons)
- initial support for [...]T{} arrays
- initial support for method expressions
- lots of bug fixes

All packages under pkg/go as well as pkg/exp/types typecheck
now with pkg/exp/gotype applied to them; i.e., a significant
amount of typechecking works now (several statements are not
implemented yet, but handling statements is almost trivial in
comparison with typechecking expressions).

R=rsc
CC=golang-dev
https://golang.org/cl/6768063

12 years agocmd/cgo: improve gccgo support
Ian Lance Taylor [Thu, 1 Nov 2012 18:21:30 +0000 (11:21 -0700)]
cmd/cgo: improve gccgo support

Use wrapper functions to tell scheduler what we are doing.

With this patch, and a separate patch to the go tool, all the
cgo tests pass with gccgo.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6812058

12 years agocmd/go: fixes to gccgo support
Ian Lance Taylor [Thu, 1 Nov 2012 18:13:50 +0000 (11:13 -0700)]
cmd/go: fixes to gccgo support

* Use -fgo-pkgpath and -gccgopkgpath rather than -fgo-prefix
  and -gccgoprefix.
* Define GOPKGPATH when compiling .c or .s files for gccgo.
* Use -fgo-relative-import-path.
* Produce .o files for gccgo, not .[568] files.
* Pass -E when linking if using cgo.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6820064

12 years agogo/build: support compiler as build constraint
Ian Lance Taylor [Thu, 1 Nov 2012 18:12:15 +0000 (11:12 -0700)]
go/build: support compiler as build constraint

This supports writing different .c/.s code when using gccgo.

R=golang-dev, dsymonds, iant, rsc
CC=golang-dev
https://golang.org/cl/6823055

12 years agocmd/gc: racewalk: fix instrumentation of ninit lists
Dmitriy Vyukov [Thu, 1 Nov 2012 18:11:12 +0000 (22:11 +0400)]
cmd/gc: racewalk: fix instrumentation of ninit lists
The idea is to (1) process ninit of all nodes,
and (2) put instrumentation of ninit into the nodes themselves (not the top-level statement ninit).
Fixes #4304.

R=golang-dev, rsc
CC=golang-dev, lvd
https://golang.org/cl/6818049

12 years agocmd/gc: fix incomplete export data when inlining with local variables.
Rémy Oudompheng [Thu, 1 Nov 2012 18:06:52 +0000 (19:06 +0100)]
cmd/gc: fix incomplete export data when inlining with local variables.

When local declarations needed unexported types, these could
be missing in the export data.

Fixes build with -gcflags -lll, except for exp/gotype.

R=golang-dev, rsc, lvd
CC=golang-dev
https://golang.org/cl/6813067

12 years agorun.bash: add sanity test for race detector
Dmitriy Vyukov [Thu, 1 Nov 2012 18:02:52 +0000 (22:02 +0400)]
run.bash: add sanity test for race detector

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6612064

12 years agocmd/gc: fix inlining bug with local variables.
Rémy Oudompheng [Thu, 1 Nov 2012 17:59:32 +0000 (18:59 +0100)]
cmd/gc: fix inlining bug with local variables.

Fixes #4323.

R=rsc, lvd, golang-dev
CC=golang-dev
https://golang.org/cl/6815061

12 years agocompress/flate: shrink decompressor struct for better performance
Ryan Hitchman [Thu, 1 Nov 2012 17:57:24 +0000 (13:57 -0400)]
compress/flate: shrink decompressor struct for better performance

Helps with issue 2703.

R=dave, minux.ma, rsc
CC=golang-dev
https://golang.org/cl/5536078

12 years agocmd/gc: do simple bounds checking of constant indices/slices in typecheck.
Daniel Morsing [Thu, 1 Nov 2012 17:45:19 +0000 (18:45 +0100)]
cmd/gc: do simple bounds checking of constant indices/slices in typecheck.

This should make the compiler emit errors specific to the bounds checking instead of overflow errors on the underlying types.

Updates #4232.

R=rsc
CC=golang-dev
https://golang.org/cl/6783054

12 years agospec: clarify returns, defer statements, and panics
Robert Griesemer [Thu, 1 Nov 2012 17:13:48 +0000 (10:13 -0700)]
spec: clarify returns, defer statements, and panics

This is an attempt at making the interaction between
these three constructs clearer. Specifically:

- return statements terminate a function, execute deferred
  functions, return to the caller, and then execution
  continues after the call

- panic calls terminate a function, execute deferred
  functions, return to the caller, and then re-panic

- deferred functions are executed before a function _returns_
  to its caller

The hope is that with this change it becomes clear when a
deferred function is executed (when a function returns),
and when it is not (when a program exits).

R=r, rsc, iant, ken, iant
CC=golang-dev
https://golang.org/cl/6736071

12 years agoruntime: move Itab to runtime.h
Jan Ziak [Thu, 1 Nov 2012 17:13:20 +0000 (13:13 -0400)]
runtime: move Itab to runtime.h

The 'type' field of Itab will be used by the garbage collector.

R=rsc
CC=golang-dev
https://golang.org/cl/6815059

12 years agonet: fix a bad cast in dnsmsg.go
Alexey Borzenkov [Thu, 1 Nov 2012 16:57:44 +0000 (12:57 -0400)]
net: fix a bad cast in dnsmsg.go

Incorrect cast was causing panics when
calling String() on dnsMsg with dnsRR_A
answers.

R=golang-dev, dave, rsc
CC=golang-dev
https://golang.org/cl/6818043

12 years agoruntime: add memorydump() debugging function
Jan Ziak [Thu, 1 Nov 2012 16:56:25 +0000 (12:56 -0400)]
runtime: add memorydump() debugging function

R=golang-dev
CC=golang-dev, remyoudompheng, rsc
https://golang.org/cl/6780059

12 years agocmd/gc: avoid %#x of 0
Russ Cox [Thu, 1 Nov 2012 16:55:21 +0000 (12:55 -0400)]
cmd/gc: avoid %#x of 0

Plan 9 and Go's lib9/fmt disagree on whether %#x includes the 0x prefix
when printing 0, because ANSI C gave bad advice long ago.

Avoiding that case makes binaries compiled on different systems compatible.

R=ken2
CC=akumar, golang-dev
https://golang.org/cl/6814066

12 years agowebsite: remove floating topbar
Andrew Gerrand [Thu, 1 Nov 2012 16:30:49 +0000 (03:30 +1100)]
website: remove floating topbar

This caused more problems than it was worth.

Fixes #4301.
Fixes #4317.

R=golang-dev, minux.ma, rsc
CC=golang-dev
https://golang.org/cl/6818076

12 years agocmd/5g, cmd/6g, cmd/8g: remove width check for componentgen.
Rémy Oudompheng [Thu, 1 Nov 2012 13:36:08 +0000 (14:36 +0100)]
cmd/5g, cmd/6g, cmd/8g: remove width check for componentgen.

The move to 64-bit ints in 6g made componentgen ineffective.
In componentgen, the code already selects which values it can handle.

On amd64:
benchmark                 old ns/op    new ns/op    delta
BenchmarkBinaryTree17    9477970000   9582314000   +1.10%
BenchmarkFannkuch11      5928750000   5255080000  -11.36%
BenchmarkGobDecode         37103040     31451120  -15.23%
BenchmarkGobEncode         16042490     16844730   +5.00%
BenchmarkGzip             811337400    741373600   -8.62%
BenchmarkGunzip           197928700    192844500   -2.57%
BenchmarkJSONEncode       224164100    140064200  -37.52%
BenchmarkJSONDecode       258346800    231829000  -10.26%
BenchmarkMandelbrot200      7561780      7601615   +0.53%
BenchmarkParse             12970340     11624360  -10.38%
BenchmarkRevcomp         1969917000   1699137000  -13.75%
BenchmarkTemplate         296182000    263117400  -11.16%

R=nigeltao, dave, daniel.morsing
CC=golang-dev
https://golang.org/cl/6821052

12 years agorun.bat: make output consistent
Alex Brainman [Thu, 1 Nov 2012 02:04:08 +0000 (13:04 +1100)]
run.bat: make output consistent

R=golang-dev, minux.ma
CC=golang-dev
https://golang.org/cl/6811059

12 years agoall: clear execute bit
Mikio Hara [Thu, 1 Nov 2012 01:04:42 +0000 (10:04 +0900)]
all: clear execute bit

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/6826044

12 years agoimage/png: degrade gracefully for palette index values that aren't
Nigel Tao [Thu, 1 Nov 2012 00:46:06 +0000 (11:46 +1100)]
image/png: degrade gracefully for palette index values that aren't
defined by the PLTE chunk. Such pixels decode to opaque black,
which matches what libpng does.

Fixes #4319.

On my reading, the PNG spec isn't clear whether palette index values
outside of those defined by the PLTE chunk is an error, and if not,
what to do.

Libpng 1.5.3 falls back to opaque black. png_set_PLTE says:

/* Changed in libpng-1.2.1 to allocate PNG_MAX_PALETTE_LENGTH instead
 * of num_palette entries, in case of an invalid PNG file that has
 * too-large sample values.
 */
png_ptr->palette = (png_colorp)png_calloc(png_ptr,
        PNG_MAX_PALETTE_LENGTH * png_sizeof(png_color));

ImageMagick 6.5.7 returns an error:

$ convert -version
Version: ImageMagick 6.5.7-8 2012-08-17 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2009 ImageMagick Studio LLC
Features: OpenMP
$ convert packetloss.png x.bmp
convert: Invalid colormap index `packetloss.png' @ image.c/SyncImage/3849.

R=r
CC=golang-dev
https://golang.org/cl/6822065

12 years agoencoding/json: clarify correct usage of struct tags in associated article.
Dan Callahan [Wed, 31 Oct 2012 22:52:27 +0000 (15:52 -0700)]
encoding/json: clarify correct usage of struct tags in associated article.

Fixes #4297.

R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/6817045

12 years agoA+C: adding Dan Callahan (individual CLA)
Robert Griesemer [Wed, 31 Oct 2012 22:52:15 +0000 (15:52 -0700)]
A+C: adding Dan Callahan (individual CLA)

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/6815062

12 years agospec: slight wording change to remove a formal contradiction
Robert Griesemer [Wed, 31 Oct 2012 22:07:25 +0000 (15:07 -0700)]
spec: slight wording change to remove a formal contradiction

Fixes #4324.

R=r
CC=golang-dev
https://golang.org/cl/6822062

12 years agocrypto/cipher: add examples
Adam Langley [Wed, 31 Oct 2012 20:37:26 +0000 (16:37 -0400)]
crypto/cipher: add examples

Fixes #1390.

R=golang-dev, minux.ma, adg, agl
CC=golang-dev
https://golang.org/cl/6631044

12 years agogofmt: simplify slices of the form s[a : len(s)] to s[a:]
Robert Griesemer [Wed, 31 Oct 2012 18:48:55 +0000 (11:48 -0700)]
gofmt: simplify slices of the form s[a : len(s)] to s[a:]

Fixes #4314.

R=r, rsc
CC=golang-dev
https://golang.org/cl/6822059

12 years agosrc/lib9/utf: update to Unicode 6.2.0
Rob Pike [Wed, 31 Oct 2012 17:52:59 +0000 (10:52 -0700)]
src/lib9/utf: update to Unicode 6.2.0
Fixes #2874.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6820068

12 years agospec: we're now at Unicode 6.2.0
Rob Pike [Wed, 31 Oct 2012 17:32:15 +0000 (10:32 -0700)]
spec: we're now at Unicode 6.2.0

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6812060

12 years agostrconv: update to unicode 6.2.0
Rob Pike [Wed, 31 Oct 2012 17:11:04 +0000 (10:11 -0700)]
strconv: update to unicode 6.2.0
Fixes build, too.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6775088

12 years agounicode: move unicode and related packages to Unicode 6.2.0.
Marcel van Lohuizen [Wed, 31 Oct 2012 16:32:16 +0000 (17:32 +0100)]
unicode: move unicode and related packages to Unicode 6.2.0.

R=r, mpvl
CC=golang-dev
https://golang.org/cl/6818067

12 years agoexp/locale/collate: implementation of tailorings and table generation.
Marcel van Lohuizen [Wed, 31 Oct 2012 13:28:44 +0000 (14:28 +0100)]
exp/locale/collate: implementation of tailorings and table generation.
Tailorings are represented by removing and reinserting entries from a linked list.
After all tailorings are done, missing weights are computed and verified.
This implementation assumes that entries that are used in expansions are not
reinserted at a later point.  This considerably simplifies the implementation.

R=r
CC=golang-dev
https://golang.org/cl/6739052

12 years agoexp/locale/collate: removed weights struct to allow for faster and easier
Marcel van Lohuizen [Wed, 31 Oct 2012 13:28:18 +0000 (14:28 +0100)]
exp/locale/collate: removed weights struct to allow for faster and easier
incremental comparisons. Instead, processing is now done directly on colElems.
As a result, the size of the weights array is now reduced by 75%.
Details:
- Primary value of type 1 colElem is shifted by 1 bit so that primaries
  of all types can be compared without shifting.
- Quaternary values are now stored in the colElem itself. This is possible
  as quaternary values other than 0 or maxQuaternary are only needed when other
  values are ignored.
- Simplified processWeights by removing cases that are needed for ICU but not
  for us (our CJK primary values fit in a single value).

R=r
CC=golang-dev
https://golang.org/cl/6817054

12 years agoexp/locale/collate: add context to entry.
Marcel van Lohuizen [Wed, 31 Oct 2012 13:02:43 +0000 (14:02 +0100)]
exp/locale/collate: add context to entry.

R=r
CC=golang-dev
https://golang.org/cl/6727049

12 years agotest: match gccgo error messages for bug358.go
Ian Lance Taylor [Wed, 31 Oct 2012 03:56:32 +0000 (20:56 -0700)]
test: match gccgo error messages for bug358.go

I fixed a bug in gccgo that was causing it to only give an
error for the first package that was imported and not used.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/6813058

12 years agosyscall/exec_linux: enable changing controlling tty
Peter Waller [Wed, 31 Oct 2012 00:36:18 +0000 (17:36 -0700)]
syscall/exec_linux: enable changing controlling tty

As discussed in the following thread:
https://groups.google.com/forum/?fromgroups=#!topic/golang-dev/emeJffxWhVo

This is required to enable applications such as `less` to use something
other than stdin as the controlling terminal.

R=dave, iant
CC=bradfitz, golang-dev
https://golang.org/cl/6785057

12 years agoA+C: add Peter Waller (individual CLA)
Ian Lance Taylor [Wed, 31 Oct 2012 00:24:01 +0000 (17:24 -0700)]
A+C: add Peter Waller (individual CLA)

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/6775083

12 years agonet: fix connection resets when closed on windows
Alex Brainman [Tue, 30 Oct 2012 23:24:37 +0000 (10:24 +1100)]
net: fix connection resets when closed on windows

It is common to close network connection while another goroutine is
blocked reading on another goroutine. This sequence corresponds to
windows calls to WSARecv to start io, followed by GetQueuedCompletionStatus
that blocks until io completes, and, finally, closesocket called from
another thread. We were expecting that closesocket would unblock
GetQueuedCompletionStatus, and it does, but not always
(http://code.google.com/p/go/issues/detail?id=4170#c5). Also that sequence
results in connection is being reset.

This CL inserts CancelIo between GetQueuedCompletionStatus and closesocket,
and waits for both WSARecv and GetQueuedCompletionStatus to complete before
proceeding to closesocket.  This seems to fix both connection resets and
issue 4170. It also makes windows code behave similar to unix version.

Unfortunately, CancelIo needs to be called on the same thread as WSARecv.
So we have to employ strategy we use for connections with deadlines to
every connection now. It means, there are 2 unavoidable thread switches
for every io. Some newer versions of windows have new CancelIoEx api that
doesn't have these drawbacks, and this CL uses this capability when available.
As time goes by, we should have less of CancelIo and more of CancelIoEx
systems. Computers with CancelIoEx are also not affected by issue 4195 anymore.

Fixes #3710
Fixes #3746
Fixes #4170
Partial fix for issue 4195

R=golang-dev, mikioh.mikioh, bradfitz, rsc
CC=golang-dev
https://golang.org/cl/6604072

12 years agoimage/jpeg: don't call ensureNBits unless we have to.
Nigel Tao [Tue, 30 Oct 2012 23:02:11 +0000 (10:02 +1100)]
image/jpeg: don't call ensureNBits unless we have to.

benchmark                     old ns/op    new ns/op    delta
BenchmarkDecodeBaseline         3155638      2783998  -11.78%
BenchmarkDecodeProgressive      4008088      3660310   -8.68%

R=r, bradfitz
CC=golang-dev
https://golang.org/cl/6775072

12 years agonet: use read deadline in Accept on windows
Alexey Borzenkov [Tue, 30 Oct 2012 22:58:05 +0000 (09:58 +1100)]
net: use read deadline in Accept on windows

Fixes #4296.

R=golang-dev, alex.brainman
CC=golang-dev
https://golang.org/cl/6815044

12 years agoreflect: improve documentation for DeepEqual regarding maps
Rob Pike [Tue, 30 Oct 2012 21:42:47 +0000 (14:42 -0700)]
reflect: improve documentation for DeepEqual regarding maps
Keys use ==; values use deep equality. Also remove the word 'member'.
Fixes #4258.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6812055

12 years agogofmt: apply gofmt -w src misc
Robert Griesemer [Tue, 30 Oct 2012 20:38:01 +0000 (13:38 -0700)]
gofmt: apply gofmt -w src misc

Remove trailing whitespace in comments.
No other changes.

R=r
CC=golang-dev
https://golang.org/cl/6815053

12 years agogo/printer, gofmt: trim trailing whitespace in comments
Robert Griesemer [Tue, 30 Oct 2012 20:09:47 +0000 (13:09 -0700)]
go/printer, gofmt: trim trailing whitespace in comments

Also: updated go fix testcases to pass tests.

Fixes #4310.

R=r
CC=golang-dev
https://golang.org/cl/6810055

12 years agoarchive/zip: handle corrupt extra data records
Dave Cheney [Tue, 30 Oct 2012 16:51:59 +0000 (03:51 +1100)]
archive/zip: handle corrupt extra data records

Fixes #4302.

R=golang-dev, bradfitz, adg
CC=golang-dev
https://golang.org/cl/6811048

12 years agoexp/gotype: add more test packages
Robert Griesemer [Tue, 30 Oct 2012 16:42:43 +0000 (09:42 -0700)]
exp/gotype: add more test packages

R=r
CC=golang-dev
https://golang.org/cl/6822051

12 years agocmd/ld: handle weak symbols
Shenghou Ma [Tue, 30 Oct 2012 15:58:43 +0000 (23:58 +0800)]
cmd/ld: handle weak symbols
compiler_rt introduces a weak and hidden symbol compilerrt_abort_impl
into our pre-linked _all.o object, we have to handle it.

Fixes #4273.

R=iant, rsc, r
CC=golang-dev
https://golang.org/cl/6783050

12 years agomisc/dashboard/builder: check http status before processing response
Dave Cheney [Tue, 30 Oct 2012 15:24:08 +0000 (02:24 +1100)]
misc/dashboard/builder: check http status before processing response

Occasionally GAE will return a 500 error response, don't treat this as a valid JSON body.

R=adg, dsymonds
CC=golang-dev
https://golang.org/cl/6775066

12 years agocmd/api: handle contexts re-converging
Brad Fitzpatrick [Tue, 30 Oct 2012 12:12:59 +0000 (13:12 +0100)]
cmd/api: handle contexts re-converging

Fixes #4303

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/6816058

12 years agocmd/api: add more tests
Brad Fitzpatrick [Tue, 30 Oct 2012 10:23:44 +0000 (11:23 +0100)]
cmd/api: add more tests

Feature extraction was tested before, but not the final diffs.

This CL breaks function main into a smaller main + testable
compareAPI.

No functional changes.

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/6820057

12 years agoio: add ByteWriter interface
Brad Fitzpatrick [Tue, 30 Oct 2012 09:51:29 +0000 (10:51 +0100)]
io: add ByteWriter interface

API change.

R=golang-dev, dsymonds, nigeltao, rsc, r
CC=golang-dev
https://golang.org/cl/6760045

12 years agoimage/jpeg: change block from [64]int to [64]int32.
Nigel Tao [Tue, 30 Oct 2012 00:10:08 +0000 (11:10 +1100)]
image/jpeg: change block from [64]int to [64]int32.

On 6g/linux:
benchmark                     old ns/op    new ns/op    delta
BenchmarkFDCT                      4606         4241   -7.92%
BenchmarkIDCT                      4187         3923   -6.31%
BenchmarkDecodeBaseline         3154864      3170224   +0.49%
BenchmarkDecodeProgressive      4072812      4017132   -1.37%
BenchmarkEncode                39406920     34596760  -12.21%

Stack requirements before (from 'go tool 6g -S'):
(scan.go:37) TEXT    (*decoder).processSOS+0(SB),$1352-32
(writer.go:448) TEXT    (*encoder).writeSOS+0(SB),$5344-24

after:
(scan.go:37) TEXT    (*decoder).processSOS+0(SB),$1064-32
(writer.go:448) TEXT    (*encoder).writeSOS+0(SB),$2520-24

Also, in encoder.writeSOS, re-use the yBlock scratch buffer for Cb and
Cr. This reduces the stack requirement slightly, but also avoids an
unlucky coincidence where a BenchmarkEncode stack split lands between
encoder.writeByte and bufio.Writer.WriteByte, which occurs very often
during Huffman encoding and is otherwise disasterous for the final
benchmark number. FWIW, the yBlock re-use *without* the s/int/int32/
change does not have a noticable effect on the benchmarks.

R=r
CC=golang-dev, rsc
https://golang.org/cl/6823043

12 years agoencoding/json: tweak docs
Roger Peppe [Mon, 29 Oct 2012 19:58:24 +0000 (20:58 +0100)]
encoding/json: tweak docs

"JSON object" means something specific, which
isn't the case here.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/6789044

12 years agosyscalls: annotate Sendfile() for race detector
Dmitriy Vyukov [Mon, 29 Oct 2012 19:15:06 +0000 (23:15 +0400)]
syscalls: annotate Sendfile() for race detector
Fixes #4306.

R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/6816054

12 years agonet/http/client.go: fix cookie handling on (*Client) Do()
Pawel Szczur [Mon, 29 Oct 2012 16:56:31 +0000 (17:56 +0100)]
net/http/client.go: fix cookie handling on (*Client) Do()

Fix the problem with no cookie handling when sending
other than GET or HEAD request through
(*Client) Do(*Request) (*Resposne, error).
https://code.google.com/p/go/issues/detail?id=3985

Adds a function (*Client) send(*Request) (*Reponse, error):
- sets cookies from CookieJar to request,
- sends request
- parses a reply cookies and updates CookieJar

Fixes #3985

R=bradfitz
CC=gobot, golang-dev
https://golang.org/cl/6653049

12 years agoCONTRIBUTORS: add Pawel Szczur (Google CLA)
Brad Fitzpatrick [Mon, 29 Oct 2012 16:54:22 +0000 (17:54 +0100)]
CONTRIBUTORS: add Pawel Szczur (Google CLA)

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/6820049

12 years agocrypto/x509: always write validity times in UTC.
Adam Langley [Mon, 29 Oct 2012 15:16:58 +0000 (11:16 -0400)]
crypto/x509: always write validity times in UTC.

RFC 5280 section 4.1.2.5.1 says so.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/6775068

12 years agoencoding/asn1: don't convert UTCTime to UTC.
Adam Langley [Mon, 29 Oct 2012 15:16:05 +0000 (11:16 -0400)]
encoding/asn1: don't convert UTCTime to UTC.

Previously we converted a time to UTC *and* serialized the timezone of
the original time. With this change, we serialize a UTCTime in the
original timezone.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/6817048

12 years agocmd/gc: inlining functions with local variables
Luuk van Dijk [Mon, 29 Oct 2012 12:55:27 +0000 (13:55 +0100)]
cmd/gc: inlining functions with local variables

- make sure dclcontext == PAUTO only in function bodies
- introduce PDISCARD to discard declarations in bodies of repeated imports
- skip printing initializing OAS'es in export mode, assuming they only occur after ODCL's
- remove ODCL and the initializing OAS from inl.c:ishairy
- fix confused use of ->typecheck in typecheckinl: it's about the ->inl, not about the fn.
- debuging aids: print ntype on ONAMEs too and -Emm instead of -Ell.

fixes #2812

R=rsc
CC=golang-dev
https://golang.org/cl/6800043

12 years agocmd/gc: escape analysis to track flow of in to out parameters.
Luuk van Dijk [Mon, 29 Oct 2012 12:38:21 +0000 (13:38 +0100)]
cmd/gc: escape analysis to track flow of in to out parameters.

includes step 0: synthesize outparams, from 6600044
includes step 1,2: give outparams loopdepth 0 and verify unchanged results
         generate esc:$mask tags, but still tie to sink if a param has mask != 0
from 6610054

adds final steps:
- have esccall generate n->escretval, a list of nodes the function results flow to
- use these in esccall and ORETURN/OAS2FUNC/and f(g())
- only tie parameters to sink if tag is absent, otherwise according to mask, tie them to escretval

R=rsc, bradfitz
CC=dave, gobot, golang-dev, iant, rsc
https://golang.org/cl/6741044

12 years agomisc/vim: fix reimport guard and remove K mapping.
Andrew Radev [Mon, 29 Oct 2012 11:10:59 +0000 (22:10 +1100)]
misc/vim: fix reimport guard and remove K mapping.

The "did_ftplugin" lines were ineffective and the "K" mapping was too
invasive, which is why it was removed.

R=golang-dev, dsymonds, minux.ma
CC=golang-dev
https://golang.org/cl/6823044

12 years agoA+C: Andrey Radev (individual CLA).
David Symonds [Mon, 29 Oct 2012 11:10:45 +0000 (22:10 +1100)]
A+C: Andrey Radev (individual CLA).

R=golang-dev, bradfitz
CC=andrey.radev, golang-dev
https://golang.org/cl/6775067

12 years agomisc/dashboard/codereview: only accept "NOT LGTM" on the first line of a message.
David Symonds [Mon, 29 Oct 2012 11:03:58 +0000 (22:03 +1100)]
misc/dashboard/codereview: only accept "NOT LGTM" on the first line of a message.

Too many people quote entire emails and put their reply at the top ("top posting"),
so we shouldn't recognise review commands anywhere in the review text.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/6815048

12 years agocmd/5g: introduce componentgen for better registerization.
Rémy Oudompheng [Sun, 28 Oct 2012 19:11:21 +0000 (20:11 +0100)]
cmd/5g: introduce componentgen for better registerization.

It is essentially identical to the version in 6g.

R=dave, minux.ma, rsc
CC=golang-dev
https://golang.org/cl/6710043

12 years agocontainer/list: fix typo
Taj Khattra [Sun, 28 Oct 2012 10:16:50 +0000 (21:16 +1100)]
container/list: fix typo

R=golang-dev, fullung, dave, minux.ma
CC=golang-dev
https://golang.org/cl/6682046

12 years agosort: Fixed a typo in the documentation for SearchStrings.
Patrick Smith [Sat, 27 Oct 2012 23:07:59 +0000 (10:07 +1100)]
sort: Fixed a typo in the documentation for SearchStrings.

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/6777066

12 years agosyscall: fix creds_test to reliably close os.File
Ian Lance Taylor [Fri, 26 Oct 2012 17:31:03 +0000 (10:31 -0700)]
syscall: fix creds_test to reliably close os.File

Before this patch the test would close the file descriptor but
not the os.File.  When the os.File was GC'ed, the finalizer
would close the file descriptor again.  That would cause
problems if the same file descriptor were returned by a later
call to open in another test.

On my system:

> GOGC=30 go test
--- FAIL: TestPassFD (0.04 seconds)
passfd_test.go:62:  FileConn: dup: bad file descriptor
FAIL

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6776053

12 years agoencoding/binary: ReadVarint reads a signed number, not unsigned number
Shenghou Ma [Fri, 26 Oct 2012 13:14:34 +0000 (21:14 +0800)]
encoding/binary: ReadVarint reads a signed number, not unsigned number

R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/6762051

12 years agonet: avoid allocation in setAddr
Dave Cheney [Fri, 26 Oct 2012 08:41:21 +0000 (19:41 +1100)]
net: avoid allocation in setAddr

setAddr was showing up in profiles due to string concatenation construction the os.File name field. netFD.sysfile's Name() is never used, except in dup() so I believe it is safe to avoid this allocation.

R=mikioh.mikioh, rsc
CC=golang-dev
https://golang.org/cl/6742058

12 years agocmd/5g: peep.c: reactivate some optimisations
Dave Cheney [Fri, 26 Oct 2012 07:19:10 +0000 (18:19 +1100)]
cmd/5g: peep.c: reactivate some optimisations

Thanks to Minux and Remy for their advice.

The EOR optimisation is applied to a few places in the stdlib.

// hash/crc32/crc32.go
func update(crc uint32, tab *Table, p []byte) uint32 {
crc = ^crc
for _, v := range p {
         crc = tab[byte(crc)^v] ^ (crc >> 8)
}
return ^crc
}

before:

--- prog list "update" ---
0164 (/home/dfc/go/src/pkg/hash/crc32/crc32.go:101) TEXT        update+0(SB),$12-24
0165 (/home/dfc/go/src/pkg/hash/crc32/crc32.go:101) MOVW        tab+4(FP),R8
0166 (/home/dfc/go/src/pkg/hash/crc32/crc32.go:102) MOVW        crc+0(FP),R0
0167 (/home/dfc/go/src/pkg/hash/crc32/crc32.go:102) EOR         $-1,R0,R5
0168 (/home/dfc/go/src/pkg/hash/crc32/crc32.go:103) MOVW        p+8(FP),R0
0169 (/home/dfc/go/src/pkg/hash/crc32/crc32.go:103) MOVW        R0,autotmp_0019+-12(SP)

after:

--- prog list "update" ---
0164 (/home/dfc/go/src/pkg/hash/crc32/crc32.go:101) TEXT        update+0(SB),$12-24
0165 (/home/dfc/go/src/pkg/hash/crc32/crc32.go:101) MOVW        tab+4(FP),R8
0166 (/home/dfc/go/src/pkg/hash/crc32/crc32.go:102) MOVW        crc+0(FP),R0
0167 (/home/dfc/go/src/pkg/hash/crc32/crc32.go:102) MVN         R0,R5
0168 (/home/dfc/go/src/pkg/hash/crc32/crc32.go:103) MOVW        p+8(FP),R0
0169 (/home/dfc/go/src/pkg/hash/crc32/crc32.go:103) MOVW        R0,autotmp_0019+-12(SP)

After 5l has done its work,

        crc = ^crc
   3d710:       e59d0014        ldr     r0, [sp, #20]
   3d714:       e3e0b000        mvn     fp, #0
   3d718:       e020500b        eor     r5, r0, fp

becomes

        crc = ^crc
   3d710:       e59d0014        ldr     r0, [sp, #20]
   3d714:       e1e05000        mvn     r5, r0

The MOVB optimisation has a small impact on the stdlib, in strconv
and gzip.

// GZIP (RFC 1952) is little-endian, unlike ZLIB (RFC 1950).
func put2(p []byte, v uint16) {
        p[0] = uint8(v >> 0)
        p[1] = uint8(v >> 8)
}

before:

--- prog list "put2" ---
1369 (/home/dfc/go/src/pkg/compress/gzip/gzip.go:76) TEXT       put2+0(SB),$0-16
1370 (/home/dfc/go/src/pkg/compress/gzip/gzip.go:76) MOVHU      v+12(FP),R4
1371 (/home/dfc/go/src/pkg/compress/gzip/gzip.go:77) MOVHU      R4,R0
1372 (/home/dfc/go/src/pkg/compress/gzip/gzip.go:77) MOVHU      R0,R0
1373 (/home/dfc/go/src/pkg/compress/gzip/gzip.go:77) MOVBU      R0,R1
1374 (/home/dfc/go/src/pkg/compress/gzip/gzip.go:77) MOVBU      R1,R3
1375 (/home/dfc/go/src/pkg/compress/gzip/gzip.go:77) MOVW       $p+0(FP),R1

after:

--- prog list "put2" ---
1369 (/home/dfc/go/src/pkg/compress/gzip/gzip.go:76) TEXT       put2+0(SB),$0-16
1370 (/home/dfc/go/src/pkg/compress/gzip/gzip.go:76) MOVHU      v+12(FP),R4
1371 (/home/dfc/go/src/pkg/compress/gzip/gzip.go:77) MOVHU      R4,R0
1372 (/home/dfc/go/src/pkg/compress/gzip/gzip.go:77) MOVBU      R0,R1
1373 (/home/dfc/go/src/pkg/compress/gzip/gzip.go:77) MOVBU      R1,R3
1374 (/home/dfc/go/src/pkg/compress/gzip/gzip.go:77) MOVW       $p+0(FP),R1

R=remyoudompheng, rsc, minux.ma
CC=golang-dev
https://golang.org/cl/6674048

12 years agoreflect: stop thinking that MaxFloat32 overflows float32.
Rémy Oudompheng [Fri, 26 Oct 2012 06:39:36 +0000 (08:39 +0200)]
reflect: stop thinking that MaxFloat32 overflows float32.

Fixes #4282.

R=golang-dev, minux.ma, rsc
CC=golang-dev
https://golang.org/cl/6759052

12 years agoruntime: switch to 64-bit goroutine ids
Dmitriy Vyukov [Fri, 26 Oct 2012 06:13:06 +0000 (10:13 +0400)]
runtime: switch to 64-bit goroutine ids
Fixes #4275.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6759053

12 years agocmd/6g: fix crash in cgen_bmul.
Rémy Oudompheng [Thu, 25 Oct 2012 22:29:44 +0000 (00:29 +0200)]
cmd/6g: fix crash in cgen_bmul.

Used to print:
../test/torture.go:116: internal compiler error: bad width: 0463 (../test/torture.go:116) MOVB    ,BX (0, 8)

R=nigeltao, rsc
CC=golang-dev
https://golang.org/cl/6736068

12 years agoexp/locale/collate: slightly changed collation elements:
Marcel van Lohuizen [Thu, 25 Oct 2012 11:02:31 +0000 (13:02 +0200)]
exp/locale/collate: slightly changed collation elements:
- Allow secondary values below the default value in second form. This is
  to support before tags for secondary values, as used by Chinese.
- Eliminate collation elements that are guaranteed to be immaterial
  after a weight increment.

R=r
CC=golang-dev
https://golang.org/cl/6739051

12 years agosyscall: implement (*PtraceRegs).PC() and SetPC()
Shenghou Ma [Thu, 25 Oct 2012 05:41:04 +0000 (13:41 +0800)]
syscall: implement (*PtraceRegs).PC() and SetPC()

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6763043

12 years agodoc: remove misplaced articles from references page
Andrew Gerrand [Thu, 25 Oct 2012 00:05:42 +0000 (11:05 +1100)]
doc: remove misplaced articles from references page

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/6743059

12 years agoexp/locale/collate/build: fixed problem where blocks for first byte need
Marcel van Lohuizen [Wed, 24 Oct 2012 09:41:05 +0000 (11:41 +0200)]
exp/locale/collate/build: fixed problem where blocks for first byte need
different indexes for values and index blocks. Fixes many regressions.

R=r
CC=golang-dev
https://golang.org/cl/6737057

12 years agoexp/locale/collate: clarification in comments on use of returned value.
Marcel van Lohuizen [Wed, 24 Oct 2012 09:40:32 +0000 (11:40 +0200)]
exp/locale/collate: clarification in comments on use of returned value.

R=r
CC=golang-dev
https://golang.org/cl/6752043

12 years agoexp/locale/collate/tools/colcmp: add locale to output of regression failure.
Marcel van Lohuizen [Wed, 24 Oct 2012 09:28:18 +0000 (11:28 +0200)]
exp/locale/collate/tools/colcmp: add locale to output of regression failure.

R=r
CC=golang-dev
https://golang.org/cl/6749058

12 years agocmd/gc, cmd/ld: use go.weak instead of weak as the weak symbol prefix
Russ Cox [Tue, 23 Oct 2012 15:16:08 +0000 (11:16 -0400)]
cmd/gc, cmd/ld: use go.weak instead of weak as the weak symbol prefix

Also defend our symbol prefixes (now just "go" and "type")
from use as import paths.

Fixes #4257.

R=ken2
CC=golang-dev
https://golang.org/cl/6744072

12 years agoruntime, runtime/race: add missing if(raceenabled), update package docs of pkg race
Shenghou Ma [Mon, 22 Oct 2012 18:33:51 +0000 (02:33 +0800)]
runtime, runtime/race: add missing if(raceenabled), update package docs of pkg race

R=dvyukov
CC=golang-dev
https://golang.org/cl/6733058

12 years agoexp/type/staging: implemented recent spec changes
Robert Griesemer [Mon, 22 Oct 2012 18:28:21 +0000 (11:28 -0700)]
exp/type/staging: implemented recent spec changes

Also:
- type-checking receivers
- get rid of some multiple errors at the same position

R=rsc, minux.ma
CC=golang-dev
https://golang.org/cl/6709061

12 years agocmd/gc: Mark use of builtin functions as calls.
Daniel Morsing [Mon, 22 Oct 2012 17:14:30 +0000 (19:14 +0200)]
cmd/gc: Mark use of builtin functions as calls.

Fixes #4097.

R=rsc
CC=golang-dev, gri
https://golang.org/cl/6749059

12 years agocmd/5l, cmd/6l, cmd/8l: put floating point numbers in .rodata section
Shenghou Ma [Mon, 22 Oct 2012 16:59:53 +0000 (00:59 +0800)]
cmd/5l, cmd/6l, cmd/8l: put floating point numbers in .rodata section

R=golang-dev, rsc
CC=0xe2.0x9a.0x9b, golang-dev
https://golang.org/cl/6742063

12 years agocmd/gc: escape analysis to track flow of in to out parameters.
Luuk van Dijk [Mon, 22 Oct 2012 08:18:17 +0000 (10:18 +0200)]
cmd/gc: escape analysis to track flow of in to out parameters.

includes step 0: synthesize outparams, from 6600044
step 1: give outparams loopdepth 0 and verify unchanged results
step 2: generate esc:$mask tags, but still tie to sink if a param has mask != 0
next step: use in esccall (and ORETURN with implicit OAS2FUNC) to avoid tying to sink

R=rsc
CC=golang-dev
https://golang.org/cl/6610054

12 years agocmd/gc: track parameter flow, step 0: synthesize name nodes for anonymous PPARAMOUTs...
Luuk van Dijk [Mon, 22 Oct 2012 08:09:52 +0000 (10:09 +0200)]
cmd/gc: track parameter flow, step 0: synthesize name nodes for anonymous PPARAMOUTs without breaking anything.

further work on parameter flow tracking for escape analysis depends on this.

R=rsc
CC=golang-dev
https://golang.org/cl/6600044