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


On Jun  5, 2002, Eric Christopher <echristo@redhat.com> wrote:

>> 
>> But, truth be said, for someone who just wants to walk the stack, it
>> *would* be the right answer, and one that really cares about not
>> having the function inlined could mark the function with the noinline
>> attribute so as to get the expected answer.  Which is why I was
>> undecided back when I wrote that code, and why I clearly still haven't
>> made my mind up :-)

> I think at this point it's "pick one and document it" :)

Let's leave the code alone, then, and just change the documentation to
explain the rationale: if we did it the other way, there'd be no way
to get such a function inlined.  Doing it the way we do now, we give
the user the freedom to decide, even if the result is not always the
one the user (perhaps mistakenly) expected.  FWIW, this issue is not a
new one.  It was already a problem with the RTL inliner.  The
difference is that the tree inliner can inline even functions defined
after they're used, given the right magic spell.

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


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