This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: __builtin_return_address (0) and inlining
- From: DJ Delorie <dj at redhat dot com>
- To: echristo at redhat dot com
- Cc: gcc at gcc dot gnu dot org
- Date: Wed, 5 Jun 2002 16:19:07 -0400
- Subject: Re: __builtin_return_address (0) and inlining
- References: <1023306058.31387.50.camel@ghostwheel.cygnus.com>
> Currently if you use __builtin_return_address (0) in a function that is
> inlined you'll likely get the wrong answer. I think I remember a
> conversation a while back about this, but I couldn't seem to find it.
Look in integrate.h for get_hard_reg_initial_val(), and note the other
targets that use it. I skipped MIPS because it was just too
complicated to update at the time.
When converted, __builtin_return_address(0) will properly return the
RA for the function it gets inlined into, rather than an unpredictable
value.