[PATCH] Documentation patch for __builtin_return_address

Geoff Keating geoffk@geoffk.org
Fri Jun 7 19:02:00 GMT 2002


Eric Christopher <echristo@redhat.com> writes:

> Here's a first go at explaining inlining and __builtin_return_address.

You should say "the function that will be returned to", since if
sibcall is being used that will be different from the function where
the call is.

> -- 
> I will not carve gods
> 
> 2002-06-07  Eric Christopher  <echristo@redhat.com>
> 
> 	* doc/extend.texi (Return Address): Add note explaining the
> 	side-effects of inlining on __builtin_return_address.
> 
> Index: extend.texi
> ===================================================================
> RCS file: /cvs/gcc/gcc/gcc/doc/extend.texi,v
> retrieving revision 1.78
> diff -u -p -w -r1.78 extend.texi
> --- extend.texi	4 Jun 2002 22:45:53 -0000	1.78
> +++ extend.texi	7 Jun 2002 21:13:58 -0000
> @@ -4294,7 +4294,10 @@ This function returns the return address
>  one of its callers.  The @var{level} argument is number of frames to
>  scan up the call stack.  A value of @code{0} yields the return address
>  of the current function, a value of @code{1} yields the return address
> -of the caller of the current function, and so forth.
> +of the caller of the current function, and so forth. When inlining
> +the expected behavior is that the function will return the address of
> +the function where __builtin_return_address is actually being called from.
> +To work around this behavior use the @code{noinline} function attribute.
>  
>  The @var{level} argument must be a constant integer.
>  
> 

-- 
- Geoffrey Keating <geoffk@geoffk.org> <geoffk@redhat.com>



More information about the Gcc-patches mailing list