From d526f40e5cd0a4eb35ef8b715b6318d352fbb850 Mon Sep 17 00:00:00 2001 From: bde Date: Sun, 12 May 2002 15:45:28 +0000 Subject: 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. --- sys/boot/i386/boot2/Makefile | 2 +- sys/boot/i386/gptboot/Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'sys/boot/i386') 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 \ -- cgit v1.1