https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59948
--- Comment #7 from Marc Glisse <glisse at gcc dot gnu.org> ---
There has been huge progress in gcc-5:
int m() ()
{
struct function h;
<bb 2>:
MEM[(int (*<T5c6a>) (int) *)&h] = f;
h._M_invoker = _M_invoke;
h.D.27699._M_manager = _M_manager;
std::_Function_base::_Base_manager<int (*)(int)>::_M_manager (&MEM[(struct
_Function_base *)&h]._M_functor, &MEM[(struct _Function_base *)&h]._M_functor,
3);
h ={v} {CLOBBER};
return 0;
}
Apparently we managed to inline f! For this simple testcase, all that is
missing is inlining _M_manager to realize that when the last argument is 3 it
does nothing. Then we can go back to more complicated examples like the one
linked at the end of comment #0.