__builtin_return_address (0) and inlining
Eric Christopher
echristo@redhat.com
Wed Jun 5 12:59:00 GMT 2002
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
More information about the Gcc
mailing list