-mdisable-fp-elim (was: [PATCH] Handle llvm::Triple::GNU and llvm::Triple::Hurd in several places.)

Thomas Schwinge thomas at codesourcery.com
Mon Mar 25 15:12:26 PDT 2013


Hi!

On Mon, 25 Mar 2013 11:06:05 -0700, Rafael Espíndola <rafael.espindola at gmail.com> wrote:
> > +  // Don't use a frame pointer on GNU/Linux and GNU/Hurd x86 and x86_64 if
> > +  // optimizing.
> 
> This is really just the OS, so just linux and hurd I guess.

Hmm, that's a good "question" actually -- so let's first clarify what
this is really about, what the purpose of this boolean
shouldUseFramePointer function is, which may instruct the compiler to
maintain a dedicated frame pointer, -mdisable-fp-elim.

But why would it be the kernel/OS (Linux, GNU Hurd; as specified in the
target triple) to decide this?  Having user-land code maintain a
dedicated frame pointer or not is not relevant for execution of code, is
of no interest to the kernel; it is primarily interesting for ABI
purposes, stack unwinding, which primarily is a concern to debuggers and
language-support libraries.  So should this function actually be checking
for llvm::Triple::GNU (that is, the GNU environment, meaning glibc et
al.) instead of a specific kernel?  Or, the other way round, always allow
the frame pointer to be eliminated apart for environments that can't cope
with this?  (Which exactly?)  And why is this only considered for x86
architectures?


> The patch also needs tests.

OK.


Grüße,
 Thomas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 489 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130325/d9aad251/attachment.sig>


More information about the cfe-commits mailing list