summaryrefslogtreecommitdiffstats
path: root/sys/boot/i386
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>2002-05-12 15:45:28 +0000
committerbde <bde@FreeBSD.org>2002-05-12 15:45:28 +0000
commitd526f40e5cd0a4eb35ef8b715b6318d352fbb850 (patch)
tree634244399237b71f8017ce1b87e91d94b440aa09 /sys/boot/i386
parent21ef250e0a5b998272a1153a2edf319c6d5de28e (diff)
downloadFreeBSD-src-d526f40e5cd0a4eb35ef8b715b6318d352fbb850.zip
FreeBSD-src-d526f40e5cd0a4eb35ef8b715b6318d352fbb850.tar.gz
Saved 176 bytes by compiling with -fno-guess-branch-probability. The
default of -fguess-branch-probablility causes time optimizations (?) like rewriting `if (foo) x++;' as `if (!foo) goto forth; back: ; ...; forth: x++; goto back;". This is pessimizes space especially well on i386's because one short branch gets converted to 2 long ones. Removed -fno-align-foo since it is implied by -Os. Previous commit messages seem to have overstated the new alignment bugs in gcc. The only case that affects boot2 is that -fno-align-functions (or equivalently -falign-functions=1) actually gives -falign-functions=2. This is caused by FUNCTION_BOUNDARY being 2 (bytes) instead of 1. The default case where the optimization level is 1 and no alignment options are given is more broken. All alignments are minimal, modulo the bug in FUNCTION_BOUNDARY. This is caused by toplev.c setting defaults too early. Some hacks in previous commits ar not needed now, but may as well be kept until gcc is fixed. The previous on in the Makefile saved 96 bytes of text due to the wrong FUNCTION_BOUNDARY and 32 bytes of data due to unrelated bloat in the alignment of large objects. There aren't even any options to control alignment of data.
Diffstat (limited to 'sys/boot/i386')
-rw-r--r--sys/boot/i386/boot2/Makefile2
-rw-r--r--sys/boot/i386/gptboot/Makefile2
2 files changed, 2 insertions, 2 deletions
diff --git a/sys/boot/i386/boot2/Makefile b/sys/boot/i386/boot2/Makefile
index 8cb5dd3..2e6098f 100644
--- a/sys/boot/i386/boot2/Makefile
+++ b/sys/boot/i386/boot2/Makefile
@@ -28,7 +28,7 @@ ORG1= 0x7c00
ORG2= 0x1000
CFLAGS= -elf -ffreestanding -Os -fno-builtin \
- -fno-align-functions -fno-align-jumps -fno-align-loops -fno-align-labels \
+ -fno-guess-branch-probability \
-mrtd \
-I${.CURDIR}/../btx/lib -I. \
-Wall -Waggregate-return -Wbad-function-cast -Wcast-align \
diff --git a/sys/boot/i386/gptboot/Makefile b/sys/boot/i386/gptboot/Makefile
index 8cb5dd3..2e6098f 100644
--- a/sys/boot/i386/gptboot/Makefile
+++ b/sys/boot/i386/gptboot/Makefile
@@ -28,7 +28,7 @@ ORG1= 0x7c00
ORG2= 0x1000
CFLAGS= -elf -ffreestanding -Os -fno-builtin \
- -fno-align-functions -fno-align-jumps -fno-align-loops -fno-align-labels \
+ -fno-guess-branch-probability \
-mrtd \
-I${.CURDIR}/../btx/lib -I. \
-Wall -Waggregate-return -Wbad-function-cast -Wcast-align \
OpenPOWER on IntegriCloud