[U-Boot] [PATCH][v2] Makefile:Add GCC flag -fno-delete-null-pointer-checks

Prabhakar Kushwaha prabhakar at freescale.com
Thu Jul 2 08:30:17 CEST 2015


-fdelete-null-pointer-checks flag controls global dataflow analyses and
eliminate useless checks for null pointers; It assume that if a pointer is
checked after it has already been dereferenced, it cannot be null.
This flag is enabled by default.

gcc v4.9 has more optimizations added to this option. Hence it is very
aggressive with GCC v4.9 series. Add -fno-delete-null-pointer-checks to
disable the optimization

Signed-off-by: Rohit Dharmakan <rohitarulraj at freescale.com>
Signed-off-by: Prabhakar Kushwaha <prabhakar at freescale.com>
---
Changes for v2: move to top level file

 Makefile | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Makefile b/Makefile
index 37cc4c3..0dc6c53 100644
--- a/Makefile
+++ b/Makefile
@@ -565,6 +565,7 @@ KBUILD_CFLAGS += -DBUILD_TAG='"$(BUILD_TAG)"'
 endif
 
 KBUILD_CFLAGS += $(call cc-option,-fno-stack-protector)
+KBUILD_CFLAGS += $(call cc-option,-fno-delete-null-pointer-checks)
 
 KBUILD_CFLAGS	+= -g
 # $(KBUILD_AFLAGS) sets -g, which causes gcc to pass a suitable -g<format>
-- 
1.9.1




More information about the U-Boot mailing list