]> Cypherpunks repositories - gostls13.git/commit
cmd/gc: eliminate some pointer arithmetic
authorRuss Cox <rsc@golang.org>
Thu, 5 Feb 2015 15:47:44 +0000 (10:47 -0500)
committerRuss Cox <rsc@golang.org>
Fri, 13 Feb 2015 17:31:04 +0000 (17:31 +0000)
commitacba34e45f78ca9d0eaa820051258a33b565ea22
treeaf616cda9e41b5bed4f44fee10b134ee4c7ef1ec
parentff81c14fb27beb32201f673640d2ddb5e42355bb
cmd/gc: eliminate some pointer arithmetic

In mparith, all the a1-- are problematic. Rewrite it all without pointers.
It's clearer anyway.

In popt, v is problematic because it is used both as a fixed pointer
(v = byvar[i]) and as a moving pointer (v = var; v++) aka slice.
Eliminate pointer movement.

Tested that this still produces bit-for-bit output for 'go build -a std'
compared to d260756 (current master).

Change-Id: I1a1bed0f98b594c3864fe95075dd95f9b52113e0
Reviewed-on: https://go-review.googlesource.com/4645
Reviewed-by: Austin Clements <austin@google.com>
src/cmd/gc/mparith1.c
src/cmd/gc/mparith2.c
src/cmd/gc/popt.c
src/cmd/gc/reg.c