diff options
author | Russ Cox <rsc@golang.org> | 2013-02-18 13:24:04 -0500 |
---|---|---|
committer | Russ Cox <rsc@golang.org> | 2013-02-18 13:24:04 -0500 |
commit | dc4b0e2b6ba73c54c0b18df9925409817657cb9b (patch) | |
tree | 59c5e27ef1f123a69d23aed80fe9cd027d53ca2c /src/cmd/8c | |
parent | 534bbfe9ce84a12773415d8f9f01da9e6d836dfc (diff) | |
download | go-dc4b0e2b6ba73c54c0b18df9925409817657cb9b.tar.gz |
cmd/6c, cmd/8c: cut stack frames by about half
The routine that adds an automatic to the stack was
adding ptrsize-1 to the size before rounding up.
That addition would only make sense to turn a round down
into a round up. Before a round up, it just wastes a word.
The effect was that a 6c function with one local and
one two-word function call used (8+8)+(16+8) = 40 bytes
instead of 8+16 = 24 bytes.
The wasted space mostly didn't matter, but one place where
it does matter is when trying to stay within the 128-byte
total frame constraint for #pragma textflag 7 functions.
This only affects the C compilers, not the Go compilers.
5c already had correct code, which is now copied to 6c and 8c.
R=ken2
CC=golang-dev
https://codereview.appspot.com/7303099
Diffstat (limited to 'src/cmd/8c')
-rw-r--r-- | src/cmd/8c/swt.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/cmd/8c/swt.c b/src/cmd/8c/swt.c index 18611ea1e..dc68b6035 100644 --- a/src/cmd/8c/swt.c +++ b/src/cmd/8c/swt.c @@ -632,8 +632,8 @@ align(int32 i, Type *t, int op, int32 *maxalign) int32 maxround(int32 max, int32 v) { - v += SZ_LONG-1; + v = xround(v, SZ_LONG); if(v > max) - max = xround(v, SZ_LONG); + return v; return max; } |