1
0
mirror of https://github.com/golang/go synced 2024-10-03 12:31:21 -06:00
go/src
Russ Cox 6654188190 liblink: remove dead computation of p->back in span6/span8
Originally, when this code was part of 6l/8l, every new
Prog was constructed starting with zprg, which set back=2,
and then this code walked over the list setting back=1 for
backward branches, back=0 otherwise. The initial back=2
setting was used to identify forward branches (the branched-to
instruction had back == 2 since it hadn't yet been set to 0 or 1).

When the code was extracted into liblink and linked directly
with 6a/6g/8a/8g, those programs created the Prog struct
and did not set back=2, breaking this backward branch detection.

No one noticed, because the next loop recomputes the information.
The only requirement for the next loop is that p->back == 0 or 1 for
each of the Progs in the list.

The initialization of the zprg with back=2 would cause problems
in this second loop, for the few liblink-internally-generated instructions
that are created by copying zprg, except that the first loop was
making sure that back == 0 or 1.

The first loop's manipulation of p->back can thus be deleted,
provided we also delete the zprg.back = 2 initializations.

This is awful and my fault. I apologize.

While we're here, remove the .scale = 1 from the zprg init too.
Anything that sets up a scaled index should set the scale itself.
(And mostly those come from outside liblink anyway.)

Tested by checking that all generated code is bit-for-bit
identical to before this CL.

Change-Id: I7f6e0b33ce9ccd5b7dc25e0f00429fedd0957c8c
Reviewed-on: https://go-review.googlesource.com/3574
Reviewed-by: Austin Clements <austin@google.com>
2015-02-03 18:22:35 +00:00
..
archive archive/tar: set Header.Mode in example 2015-01-26 01:54:06 +00:00
bufio bufio: add Reader.Discard 2015-01-07 06:37:57 +00:00
builtin
bytes bytes, strings: improve documentation for Count functions 2015-01-22 18:28:35 +00:00
cmd liblink: renumber ARM conditions to make C_SCOND_NONE == 0 2015-02-03 18:22:26 +00:00
compress compress/bzip2: s/repeat_power/repeatPower/ 2014-12-19 01:29:00 +00:00
container
crypto crypto/ecdsa: make Sign safe with broken entropy sources 2015-01-28 01:39:51 +00:00
database/sql database/sql: reduce lock contention in Stmt.connStmt 2015-01-24 09:56:25 +00:00
debug all: power64 is now ppc64 2014-12-05 19:13:20 -05:00
encoding encoding/json: add UnmarshalTypeError.Offset 2015-01-29 09:54:25 +00:00
errors
expvar expvar: Use sync/atomic to manipulate Int for better perf 2015-01-29 08:24:00 +00:00
flag flag: Check for Set error 2014-12-22 00:17:07 +00:00
fmt cmd/gc: allocate buffers for non-escaped strings on stack 2015-01-28 20:12:38 +00:00
go go/printer: clearer logic (clenaup) 2015-02-02 19:11:12 +00:00
hash all: power64 is now ppc64 2014-12-05 19:13:20 -05:00
html html/template: fix example code 2015-01-21 04:13:06 +00:00
image image: fix typo in Alpha16 doc comment 2015-01-25 22:46:49 +00:00
index/suffixarray
internal/syscall internal/syscall: add getrandom syscall number for ppc64/ppc64le 2015-01-21 06:29:15 +00:00
io
lib9 lib9: build tokenize on Plan 9 2015-01-21 23:27:01 +00:00
libbio
liblink liblink: remove dead computation of p->back in span6/span8 2015-02-03 18:22:35 +00:00
log log: add SetOutput method on Logger 2015-01-30 16:00:10 +00:00
math math/big: split float conversion routines and tests into separate files 2015-01-30 23:03:06 +00:00
mime mime/multipart: moved some code to mime/internal/quotedprintable 2014-12-23 19:30:02 +00:00
net net: case insensitivity of DNS labels in built-in stub resolver 2015-02-03 10:29:50 +00:00
os os: fix TestMkdirAllAtSlash on Plan 9 2015-02-02 17:01:45 +00:00
path path/filepath: make Join handle UNC paths on Windows 2015-01-20 23:23:01 +00:00
reflect reflect: cache call frames 2015-01-28 08:40:26 +00:00
regexp regexp: update URLs in tests 2015-01-26 01:54:28 +00:00
runtime runtime: fix nosplit stack overflow 2015-02-03 15:43:30 +00:00
sort sort: reduce number of comparisons needed by medianOfThree 2015-01-13 19:37:02 +00:00
strconv strconv: speed up atoi for common cases 2015-01-08 20:58:26 +00:00
strings bytes, strings: improve documentation for Count functions 2015-01-22 18:28:35 +00:00
sync sync/atomic: remove atomic pointer hammer tests 2015-01-06 00:28:22 +00:00
syscall syscall: use name+(NN)FP on linux/amd64 2015-01-21 19:04:38 +00:00
testing testing: add tracing support 2015-01-28 16:43:00 +00:00
text
time time: correctly parse large input durations and avoid precision loss 2015-01-15 00:15:58 +00:00
unicode
unsafe unsafe: minor doc string improvements 2015-01-28 19:42:15 +00:00
all.bash
all.bat
all.rc
androidtest.bash build: androidtest.bash has to use copy for files to adb-sync. 2015-01-15 13:53:03 +00:00
clean.bash
clean.bat
clean.rc
make.bash [dev.cc] build: do not pass GOHOSTOS and GOHOSTARCH to Go 1.4 build 2015-01-14 20:17:20 +00:00
make.bat [dev.cc] build: do not pass GOHOSTOS and GOHOSTARCH to Go 1.4 build 2015-01-14 20:17:20 +00:00
Make.dist
make.rc [dev.cc] build: do not pass GOHOSTOS and GOHOSTARCH to Go 1.4 build 2015-01-14 20:17:20 +00:00
nacltest.bash
race.bash
race.bat
run.bash cmd/cgo: remove obsolete -cdefs flag 2015-01-07 22:49:59 +00:00
run.bat build: change all.bash output to be more markdown-friendly 2014-12-13 00:03:23 +00:00
run.rc build: add GOTESTONLY environment test for Plan 9's run.rc 2015-01-08 04:35:23 +00:00