This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: __builtin_return_address()
- To: Richard Henderson <rth at redhat dot com>,Falk Hueffner <falk dot hueffner at student dot uni-tuebingen dot de>,gcc at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Subject: Re: __builtin_return_address()
- From: "H . J . Lu" <hjl at lucon dot org>
- Date: Sun, 22 Jul 2001 22:31:53 -0700
- References: <3B5AE146.4BA815E8@codesourcery.com> <87k810ao1h.fsf@student.uni-tuebingen.de> <20010722213652.A13909@redhat.com>
On Sun, Jul 22, 2001 at 09:36:52PM -0700, Richard Henderson wrote:
> On Sun, Jul 22, 2001 at 07:09:30PM +0200, Falk Hueffner wrote:
> > Is this a bug in gcc, or is this simply unavoidable on i386? If so,
> > the info page should mention it.
>
> Not a bug. Care to submit a documentation patch?
>
>
How about this patch?
H.J.
---
2001-07-22 H.J. Lu (hjl@gnu.org)
* doc/extend.texi: Update __builtin_return_address and
__builtin_frame_address.
Index: doc/extend.texi
===================================================================
RCS file: /cvs/gcc/gcc/gcc/doc/extend.texi,v
retrieving revision 1.15
diff -u -p -r1.15 extend.texi
--- doc/extend.texi 2001/07/17 11:58:53 1.15
+++ doc/extend.texi 2001/07/23 05:28:36
@@ -3703,7 +3703,9 @@ The @var{level} argument must be a const
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 @code{0}.
+of the stack has been reached, this function will return @code{0} or a
+randome value. However, @code{__builtin_frame_address} can be used
+to determine if the top of the stack has been reached.
This function should only be used with a non-zero argument for debugging
purposes.
@@ -3725,8 +3727,9 @@ has a dedicated frame pointer register,
then @code{__builtin_frame_address} will return the value of the frame
pointer register.
-The caveats that apply to @code{__builtin_return_address} apply to this
-function as well.
+On some machines it may be impossible to determine the frame 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 @code{0}.
@end deftypefn
@node Other Builtins