diff options
author | Ayke van Laethem <[email protected]> | 2021-11-01 18:37:00 +0100 |
---|---|---|
committer | Ron Evans <[email protected]> | 2021-11-03 13:40:13 +0100 |
commit | 7c24925aa793c11ed5748b641f804a795f9029ed (patch) | |
tree | 4f9a1562571cdc668b1b19664308b8cccccc0aeb /stacksize/stacksize.go | |
parent | d7b7583e83b877031c78cf9a727bfd338cf65892 (diff) | |
download | tinygo-7c24925aa793c11ed5748b641f804a795f9029ed.tar.gz tinygo-7c24925aa793c11ed5748b641f804a795f9029ed.zip |
compiler: add minsize attribute for -Oz
This matches the behavior of Clang, which uses optsize for -Os and adds
minsize for -Oz.
The code size change is all over the map, but using a hacked together
size comparison tool I've found that there is a slight reduction in
binary size overall (-1.6% with the tinygo smoke tests and -0.8% for the
drivers smoke test).
Diffstat (limited to 'stacksize/stacksize.go')
-rw-r--r-- | stacksize/stacksize.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/stacksize/stacksize.go b/stacksize/stacksize.go index 2b111ddcf..ee5ca472a 100644 --- a/stacksize/stacksize.go +++ b/stacksize/stacksize.go @@ -180,8 +180,8 @@ func CallGraph(f *elf.File, callsIndirectFunction []string) (map[string][]*CallN // used for getting a function pointer isCall = false case elf.R_ARM_ABS32: - // used in the reset vector for pointers - isCall = false + // when compiling with -Oz (minsize), used for calling + isCall = true default: return nil, fmt.Errorf("unknown relocation: %s", relocType) } |