1
0
mirror of https://github.com/golang/go synced 2024-11-19 16:44:43 -07:00
go/include
Russ Cox 7a7c0ffb47 cmd/gc: correct liveness for fat variables
The VARDEF placement must be before the initialization
but after any final use. If you have something like s = ... using s ...
the rhs must be evaluated, then the VARDEF, then the lhs
assigned.

There is a large comment in pgen.c on gvardef explaining
this in more detail.

This CL also includes Ian's suggestions from earlier CLs,
namely commenting the use of mode in link.h and fixing
the precedence of the ~r check in dcl.c.

This CL enables the check that if liveness analysis decides
a variable is live on entry to the function, that variable must
be a function parameter (not a result, and not a local variable).
If this check fails, it indicates a bug in the liveness analysis or
in the generated code being analyzed.

The race detector generates invalid code for append(x, y...).
The code declares a temporary t and then uses cap(t) before
initializing t. The new liveness check catches this bug and
stops the compiler from writing out the buggy code.
Consequently, this CL disables the race detector tests in
run.bash until the race detector bug can be fixed
(golang.org/issue/7334).

Except for the race detector bug, the liveness analysis check
does not detect any problems (this CL and the previous CLs
fixed all the detected problems).

The net test still fails with GOGC=0 but the rest of the tests
now pass or time out (because GOGC=0 is so slow).

TBR=iant
CC=golang-codereviews
https://golang.org/cl/64170043
2014-02-15 10:58:55 -05:00
..
plan9 lib9: enable on Plan 9 2014-02-13 20:06:41 +01:00
ar.h gopack: change archive file name length back to 16 2011-11-01 00:29:16 -04:00
bio.h build: do not use the host's libbio on Plan 9 2013-12-09 18:39:58 -05:00
bootexec.h
fmt.h convert C runtime to 32-bit runes; 2009-08-31 16:38:50 -07:00
libc.h cmd/dist, cmd/ld: GO_EXTLINK_ENABLED=0 defaults to -linkmode=internal 2013-03-29 16:33:35 -07:00
link.h cmd/gc: correct liveness for fat variables 2014-02-15 10:58:55 -05:00
mach.h libmach: support reading symbols from Windows .exe for nm 2011-08-29 14:25:43 -04:00
README include: add a README file 2013-05-22 18:51:15 +08:00
u.h liblink: create new library based on linker code 2013-12-08 22:49:37 -05:00
ureg_amd64.h libmach: use different names for different Ureg types 2014-01-08 20:37:27 -05:00
ureg_arm.h libmach: use different names for different Ureg types 2014-01-08 20:37:27 -05:00
ureg_x86.h libmach: use different names for different Ureg types 2014-01-08 20:37:27 -05:00
utf.h

The header files under this directory are strictly internal to the gc
toolchain, so please don't copy them to the system include file
directory (/usr/include, /usr/local/include, etc.)

Also note that they must be kept as is in $GOROOT/include, or cmd/dist
will malfunction.