Skip to content

Commit c977214

Browse files
committed
Shrink the smallest builds with compile options
1 parent c68073e commit c977214

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

ports/atmel-samd/Makefile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,13 @@ else
150150
CFLAGS += -flto -flto-partition=none
151151

152152
ifeq ($(CIRCUITPY_FULL_BUILD),0)
153-
CFLAGS += --param inline-unit-growth=15 --param max-inline-insns-auto=20
153+
# Increasing max-inline-insns-auto from 20 to 1000 gains about 300 bytes on a small build.
154+
CFLAGS += --param inline-unit-growth=15 --param max-inline-insns-auto=1000
155+
# These optimizations are normally -O3 only. They improve the way register
156+
# allocation is done, but, to quote the gcc doc, 'can, however, make debugging impossible,
157+
# since variables will no longer stay in a “home register”.'
158+
# On a small build they can gain about 200 bytes.
159+
CFLAGS += -fweb -frename-registers
154160
endif
155161

156162
ifdef CFLAGS_BOARD

0 commit comments

Comments
 (0)