1
0
mirror of https://github.com/golang/go synced 2024-10-04 06:21:23 -06:00
go/src/cmd/6g
Russ Cox 0a8a719ded cmd/5g, cmd/6g, cmd/8g: preserve wide values in large functions
In large functions with many variables, the register optimizer
may give up and choose not to track certain variables at all.
In this case, the "nextinnode" information linking together
all the words from a given variable will be incomplete, and
the result may be that only some of a multiword value is
preserved across a call. That confuses the garbage collector,
so don't do that. Instead, mark those variables as having
their address taken, so that they will be preserved at all
calls. It's overkill, but correct.

Tested by hand using the 6g -S output to see that it does fix
the buggy generated code leading to the issue 7726 failure.

There is no automated test because I managed to break the
compiler while writing a test (see issue 7727). I will check
in a test along with the fix to issue 7727.

Fixes #7726.

LGTM=khr
R=khr, bradfitz, dave
CC=golang-codereviews
https://golang.org/cl/85200043
2014-04-16 13:59:42 -04:00
..
cgen.c cmd/6g, cmd/8g: disable Duff's device on NaCl. 2014-04-04 08:42:35 +02:00
doc.go cmd/godoc: use go/build to determine package and example files 2013-02-19 11:19:58 -08:00
galign.c cmd/6g: remove unused stosptr variable 2014-03-19 17:18:25 -07:00
gg.h cmd/6g: remove unused stosptr variable 2014-03-19 17:18:25 -07:00
ggen.c cmd/6g: nacl: zero odd multiple of widthptr correctly 2014-04-10 07:59:46 -07:00
gobj.c cmd/gc: bypass DATA instruction for data initialized to integer constant 2013-12-20 14:24:39 -05:00
gsubr.c cmd/ld: clear unused ctxt before morestack 2014-03-04 13:53:08 -05:00
Makefile build: delete make paraphernalia 2012-02-06 13:34:25 -05:00
opt.h cmd/gc: add temporary-merging optimization pass 2013-08-13 00:09:31 -04:00
peep.c cmd/gc: shorten temporary lifetimes when possible 2014-04-01 13:31:38 -04:00
prog.c runtime: get rid of most uses of REP for copying/zeroing. 2014-04-01 12:51:02 -07:00
reg.c cmd/5g, cmd/6g, cmd/8g: preserve wide values in large functions 2014-04-16 13:59:42 -04:00