This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
__builtin_return_address (0) and inlining
- From: Eric Christopher <echristo at redhat dot com>
- To: gcc at gcc dot gnu dot org
- Date: 05 Jun 2002 12:40:57 -0700
- Subject: __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.
Now, unfortunately the docs don't say a whole lot on the subject, just
that for N > 0, __builtin_return_address should only be used for
debugging purposes. I've taken a look at the code and it should be
pretty easy to make __builtin_return_address work if we turn off
inlining for those functions. Similar to the #if 0'd work in
c-objc-common.c:96. Otherwise we should probably mention this in the
docs. I'll work up a patch either way, I'd just like to see what the
"correct" behavior should be.
-eric
--
I will not carve gods