This is the mail archive of the gcc-patches@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 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


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