From 1873e870fd63ee4b87dbe0125ca373e420fb4987 Mon Sep 17 00:00:00 2001 From: Andi Kleen Date: Wed, 28 Mar 2012 11:51:18 -0700 Subject: debug: Add CONFIG_READABLE_ASM Add a config option to disable various gcc compiler optimizations that make assembler listings much harder to read. This is everything that reorders code significantly or creates partial functions. This is mainly to keep kernel hackers sane. Signed-off-by: Andi Kleen Link: http://lkml.kernel.org/r/1332960678-11879-2-git-send-email-andi@firstfloor.org Signed-off-by: H. Peter Anvin --- Makefile | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 1932984478c1..6f7328bca9c4 100644 --- a/Makefile +++ b/Makefile @@ -564,6 +564,16 @@ else KBUILD_CFLAGS += -O2 endif +ifdef CONFIG_READABLE_ASM +# Disable optimizations that make assembler listings hard to read. +# reorder blocks reorders the control in the function +# ipa clone creates specialized cloned functions +# partial inlining inlines only parts of functions +KBUILD_CFLAGS += $(call cc-option,-fno-reorder-blocks,) \ + $(call cc-option,-fno-ipa-cp-clone,) \ + $(call cc-option,-fno-partial-inlining) +endif + include $(srctree)/arch/$(SRCARCH)/Makefile ifneq ($(CONFIG_FRAME_WARN),0) -- cgit v1.2.3