This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: __builtin_return_address


On Wed, Nov 01, 2000 at 03:50:46AM -0500, Eli Zaretskii wrote:
> > 
> > 2) You cannot rely on __builtin_return_address to return any
> > meaningful information whatsoever except when its argument is zero.
> 
> ??? Then at least the GCC docs needs to be changed.  It currently
> says (in v2.95.2 release):
> 
>      On some machines it may be impossible to determine the return
>      address of any function other than the current one; in such cases,
>      or when the top of the stack has been reached, this function will
>      return `0'.
> 
> According to this, all values but zero returned from
> __builtin_return_address should be valid.
> 
> Also, is the platform the OP was talking about (Red Hat GNU/Linux)
> really one of those where __builtin_return_address doesn't work?

Ummm, Red Hat GNU/Linux runs on 3 different target hardwares.  For the x86,
__builtin_return_address with a non-zero argument only has a chance of working
if the caller was not called with -fomit-frame-pointer.

-- 
Michael Meissner, Red Hat, Inc.
PMB 198, 174 Littleton Road #3, Westford, Massachusetts 01886, USA
Work:	  meissner@redhat.com		phone: +1 978-486-9304
Non-work: meissner@spectacle-pond.org	fax:   +1 978-692-4482

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]