This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: A sibcall is also a leaf?!?
- From: Paul Brook <paul at codesourcery dot com>
- To: gcc at gcc dot gnu dot org
- Cc: "Dave Korn" <dave dot korn at artimi dot com>
- Date: Thu, 29 Mar 2007 18:08:44 +0100
- Subject: Re: A sibcall is also a leaf?!?
- References: <009401c77223$f52a7250$2e08a8c0@CAM.ARTIMI.COM>
> This logic works fine - except when gcc tells me that this sibcall
> function is a leaf, despite the fact that it calls out to another function
> that probably clobbers the call_used regs.
A leaf function is one that doesn't make any function calls. Technically
speaking, a sibcall isn't really a function call, it's "returning" to
somewhere other than the caller. For most purposes it's as if foo4's caller
made the function call, not foo4.
As you say, the correct solution is to disallow sibcalls on isr routines.
Paul