Skip to contentSkip to conversation

Makefile:Add GCC flag -fno-delete-null-pointer-checks

PATCH New Prabhakar Kushwaha 2 participants 2 messages Jul 2, 2015 – Jul 10, 2015 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 Makefile:Add GCC flag -fno-delete-null-pointer-checks

-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

---
Changes for v2: move to top level file

 Makefile | 1 +
 1 file changed, 1 insertion(+)
Makefile +1 -0
index 37cc4c3..0dc6c53 100644
@@ -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>
Signature · 1 line
1.9.1
#1 lore raw

PATCH v2 1/1 Makefile:Add GCC flag -fno-delete-null-pointer-checks

Quoted 11 lines · Prabhakar Kushwaha

-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

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20150710/a36809b0/attachment.sig>