Force functions marked as inline to always be inlined.
authorKevin O'Connor <kevin@koconnor.net>
Tue, 11 Mar 2008 23:32:38 +0000 (19:32 -0400)
committerKevin O'Connor <kevin@koconnor.net>
Tue, 11 Mar 2008 23:32:38 +0000 (19:32 -0400)
Inline alters stack usage, so don't let gcc uninline.
Also, gcc seems to include multiple copies of uninlined functions when
using -combine.
With inlining forced on, the no null check optimization causes
problems, so disable it.

Makefile
src/types.h

index 6938bef..7415f6a 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -18,7 +18,8 @@ cc-option = $(shell if test -z "`$(1) $(2) -S -o /dev/null -xc \
 
 # Default compiler flags
 COMMONCFLAGS = -Wall -Os -MD -m32 -march=i386 -mregparm=2 \
-               -ffreestanding -fwhole-program -fomit-frame-pointer
+               -ffreestanding -fwhole-program -fomit-frame-pointer \
+               -fno-delete-null-pointer-checks
 COMMONCFLAGS += $(call cc-option,$(CC),-nopie,)
 COMMONCFLAGS += $(call cc-option,$(CC),-fno-stack-protector,)
 COMMONCFLAGS += $(call cc-option,$(CC),-fno-stack-protector-all,)
index b1bf2ef..0a7e2f7 100644 (file)
@@ -34,6 +34,8 @@ typedef u32 size_t;
 
 #define barrier() __asm__ __volatile__("": : :"memory")
 
+#define inline inline __attribute__((always_inline))
+
 #define __stringify_1(x)        #x
 #define __stringify(x)          __stringify_1(x)