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: Alexandre Oliva <aoliva at redhat dot com>
- To: Eric Christopher <echristo at redhat dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: 05 Jun 2002 17:52:50 -0300
- Subject: Re: __builtin_return_address (0) and inlining
- Organization: GCC Team, Red Hat
- References: <1023306058.31387.50.camel@ghostwheel.cygnus.com>
On Jun 5, 2002, Eric Christopher <echristo@redhat.com> wrote:
> 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.
IIRC, the only objection to enabling that chunk of code was that there
was no guarantee it would do the right thing if say a calls b calls c
calls d calls __builtin_return_address(2). If d is in a separate
translation unit, there's no way to tell you shouldn't inline c into
b. But I wouldn't be concerned about this case. I'd rather get it to
work in the supported case (zero as the argument), and leave it up to
the user to get it to work correctly in other cases (we can't do
better than that without whole-program knowledge). Perhaps we should
test if the operand is zero and prevent inlining only in that case?
I don't remember who (if anyone) actually objected to that code, or if
I made this all up by myself; searching the archives, I couldn't find
any reply to the message I posted in which I brought this up, that
covered this topic, but I *think* I got feedback from someone else.
Could this person please speak up?
--
Alexandre Oliva Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist Professional serial bug killer