[PATCH] Turn off sibling call optimization w/ frame pointers

From: Matthias Urlichs
Date: Fri May 20 2005 - 08:43:16 EST


Frame pointers are supposed to enable debuggers to reliably tell
where a call comes from. That is defeated by GCC's sibling call
optimization (aka tail recursion elimination).

This patch turns this optimization off when compiling with frame pointers.

Signed-Off-By: Matthias Urlichs <smurf@xxxxxxxxxxxxxx>

---
Index: Makefile
===================================================================
--- cf96cb2bd8bb633b174549815ad3c45f65ae2848/Makefile (mode:100644)
+++ df32987da12629d4a4498fc8948bf11b1a49d377/Makefile (mode:100644)
@@ -518,7 +518,7 @@
CFLAGS += $(call add-align,CONFIG_CC_ALIGN_JUMPS,-jumps)

ifdef CONFIG_FRAME_POINTER
-CFLAGS += -fno-omit-frame-pointer
+CFLAGS += -fno-omit-frame-pointer $(call cc-option,-fno-optimize-sibling-calls,)
else
CFLAGS += -fomit-frame-pointer
endif
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/