Expand gcc tests.

Verify -fwhole-program works at make startup.
Warn when gcc marks global functions as local.
diff --git a/Makefile b/Makefile
index 34a7535..7d7dbeb 100644
--- a/Makefile
+++ b/Makefile
@@ -20,7 +20,7 @@
 
 # Default compiler flags
 COMMONCFLAGS = -Wall -Os -MD -m32 -march=i386 -mregparm=3 \
-               -mpreferred-stack-boundary=2 -mrtd \
+               -mpreferred-stack-boundary=2 -mrtd -freg-struct-return \
                -ffreestanding -fwhole-program -fomit-frame-pointer \
                -fno-delete-null-pointer-checks -Wno-strict-aliasing
 COMMONCFLAGS += $(call cc-option,$(CC),-nopie,)
@@ -54,8 +54,13 @@
 
 ################ Build rules
 
+TESTGCC:=$(shell CC=$(CC) tools/test-gcc.sh)
+ifeq "$(TESTGCC)" "-1"
+$(error "Please upgrade GCC")
+endif
+
 ifndef AVOIDCOMBINE
-AVOIDCOMBINE=$(shell CC=$(CC) tools/test-combine.sh)
+AVOIDCOMBINE=$(TESTGCC)
 endif
 
 # Do a whole file compile - two methods are supported.  The first