This is the mail archive of the gcc@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]
Other format: [Raw text]

Re: __builtin_return_address (0) and inlining


> 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.


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