Change:
We currently build C++ code and Rust with frame pointers on, though we don't actually use them for anything (intended for GC). This is overhead that C and C++ don't usually have so it would be nice to turn on elimination.
I think we'll need them for gc, fwiw
on Linux x86_64 we should be using the DWARFv3 Call Frame Information for walking the stack, although I have no idea if we're emitting it correctly right now (likely on OS X and FreeBSD too). We might be, because gdb uses it and seems to work.
We'll leave it off until we have solutions for GC, which will probably end up being platform specific. libunwind should make it easy on linux and freebsd.
Reopening because this caused a regression in , so reverted in

Discussion:
$(foreach t,$(CFG_TARGET),$(eval $(call DEF_OSTYPE_VAR,$(t)))) $(foreach t,$(CFG_TARGET),$(info cfg: os for $(t) is $(OSTYPE_$(t)))) <del> # FIXME: no-omit-frame-pointer is just so that task_start_wrapper # has a frame pointer and the stack walker can understand it. Turning off # frame pointers everywhere is overkill CFG_GCCISH_CFLAGS += -fno-omit-frame-pointer </del> # On Darwin, we need to run dsymutil so the debugging information ends # up in the right place.  On other platforms, it automatically gets # embedded into the executable, so use a no-op command.

CFG_LLC_FLAGS_x86_64-unknown-linux-gnu := CFG_INSTALL_NAME_x86_64-unknown-linux-gnu = CFG_LIBUV_LINK_FLAGS_x86_64-unknown-linux-gnu = <del> CFG_LLVM_BUILD_ENV_x86_64-unknown-linux-gnu="CXXFLAGS=-fno-omit-frame-pointer" </del> CFG_EXE_SUFFIX_x86_64-unknown-linux-gnu = CFG_WINDOWSY_x86_64-unknown-linux-gnu := CFG_UNIXY_x86_64-unknown-linux-gnu := 1

CFG_LLC_FLAGS_i686-unknown-linux-gnu := CFG_INSTALL_NAME_i686-unknown-linux-gnu = CFG_LIBUV_LINK_FLAGS_i686-unknown-linux-gnu = <del> CFG_LLVM_BUILD_ENV_i686-unknown-linux-gnu="CXXFLAGS=-fno-omit-frame-pointer" </del> CFG_EXE_SUFFIX_i686-unknown-linux-gnu = CFG_WINDOWSY_i686-unknown-linux-gnu := CFG_UNIXY_i686-unknown-linux-gnu := 1

}; let use_softfp = sess.opts.debugging_opts & session::USE_SOFTFP != 0; <ins> // FIXME: #11906: Omitting frame pointers breaks retrieving the value of a parameter. let no_fp_elim = sess.opts.debuginfo; </ins> let tm = sess.targ_cfg.target_strs.target_triple.with_c_str(|T| { sess.opts.target_cpu.with_c_str(|CPU| { sess.opts.target_feature.with_c_str(|Features| {

lib::llvm::RelocPIC, OptLevel, true, <del> use_softfp </del> <ins> use_softfp, no_fp_elim </ins> ) }) })

Reloc: RelocMode, Level: CodeGenOptLevel, EnableSegstk: bool, <del> UseSoftFP: bool) -> TargetMachineRef; </del> <ins> UseSoftFP: bool, NoFramePointerElim: bool) -> TargetMachineRef; </ins> pub fn LLVMRustDisposeTargetMachine(T: TargetMachineRef); pub fn LLVMRustAddAnalysisPasses(T: TargetMachineRef, PM: PassManagerRef,

Reloc::Model RM, CodeGenOpt::Level OptLevel, bool EnableSegmentedStacks, <del> bool UseSoftFloat) { </del> <ins> bool UseSoftFloat, bool NoFramePointerElim) { </ins> std::string Error; Triple Trip(Triple::normalize(triple)); const llvm::Target *TheTarget = TargetRegistry::lookupTarget(Trip.getTriple(),

} TargetOptions Options; <del> Options.NoFramePointerElim = true; </del> <ins> Options.NoFramePointerElim = NoFramePointerElim; </ins> Options.EnableSegmentedStacks = EnableSegmentedStacks; Options.FloatABIType = FloatABI::Default; Options.UseSoftFloat = UseSoftFloat;

while_expr(40, 41, 42); loop_expr(43, 44, 45); }