https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56727

Yuri Gribov <tetra2005 at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tetra2005 at gmail dot com

--- Comment #5 from Yuri Gribov <tetra2005 at gmail dot com> ---
Created attachment 40562
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=40562&action=edit
Draft patch

(In reply to Thiago Macieira from comment #0)
> What's more, since the argument wasn't used, it's also
> unnecessary to set it.

This may be due to contrivedness of example (endless loop, etc.). The argument
seems to be forwarded in normal cases.

(In reply to Jan Hubicka from comment #3)
> The canonical way to do it is to create a static alias and the redirect call
> to the alias. We do that in FE for some specific examples (like thunks) but
> not in general.  Doing so would indeed make sense.

Would something like attached draft patch be ok?

(In reply to Jakub Jelinek from comment #4)
> Note it would need to be done with lots of care, because you can e.g. have
> aliases to the function and in that case you should go through the PLT:

Note that we already violate this. E.g. in Thiago's reprocase compiler
shouldn't have figured out
that there is and endless loop. I can also see that recursive factorial
implementation is expanded to loop
even under -fPIC. Should I fix this?

Reply via email to