This is an archive of the discontinued LLVM Phabricator instance.

Disable frame pointer elimination when -pg is used
AbandonedPublic

Authored by tm on Nov 22 2014, 7:49 AM.

Details

Reviewers
None
Summary

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'

Diff Detail

Event Timeline

tm updated this revision to Diff 16524.Nov 22 2014, 7:49 AM
tm retitled this revision from to Disable frame pointer elimination when -pg is used.
tm updated this object.
tm edited the test plan for this revision. (Show Details)
tm added a subscriber: Unknown Object (MLST).

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?

This is not desirable. The options are applicable to code generation, and should be processed from the user's perspective (even if they are now redundant). Users often specify options that are technically redundant on certain compiler versions.

tm updated this revision to Diff 16526.Nov 22 2014, 9:25 AM

I have updated patch not to generate unused argument warnings.

tm abandoned this revision.Nov 25 2015, 11:06 AM