[PATCH] Disable frame pointer elimination when -pg is used

Tomasz Mi─ůsko tomasz.miasko at gmail.com
Sat Nov 22 07:49:25 PST 2014


This patch disables frame pointer elimination and leaf frame pointer elimination when mcount instrumentation is requested ("-pg").

Currently we catch the case when -fomit-frame-pointer and -pg are explicitly used together, but we miss: 
 * Explicit use of -momit-leaf-frame-pointer.
 * Defaults enabling mentioned optimizations on given optimization level or triple.

This also emits unused argument warnings when -fno-omit-frame-pointer or -mno-omit-leaf-frame-pointer are combined with -pg. It can be changed very simply, but I am not sure if this is desirable or not?

clang -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -pg
clang: warning: argument unused during compilation: '-fno-omit-frame-pointer'
clang: warning: argument unused during compilation: '-mno-omit-leaf-frame-pointer'

http://reviews.llvm.org/D6370

Files:
  lib/Driver/Tools.cpp
  test/Driver/frame-pointer-elim.c
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D6370.16524.patch
Type: text/x-patch
Size: 2759 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20141122/17c7ea1d/attachment.bin>


More information about the cfe-commits mailing list