[PATCH] D74698: [CodeGen] -pg shouldn't add "frame-pointer"="all" fn attr w/ -mfentry

Fangrui Song via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 18 10:44:29 PST 2020


MaskRay added a comment.

When -mfentry is specified, why should frame pointers be disabled? Is that because the Linux kernel has assumption about the exact code sequence? `call __fentry__` is the first instruction. Isn't that sufficient?

(There is another difference. GCC emits `call *__fentry__ at GOTPCREL(%rip)` in -fpie/-fpic mode. At first glance, this looks suboptimal to me. I don't expect `__fentry__` to be interposed.)
(This may be another example demonstrating that piggybacking an option (-mfentry) on top of an existing one (-pg) can turn out to be a bad idea...)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D74698/new/

https://reviews.llvm.org/D74698





More information about the cfe-commits mailing list