https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79671
--- Comment #57 from Jonathan Wakely <redi at gcc dot gnu.org> ---
OK, so this appears to work (assuming may_alias on function_buffer):
function_buffer& aliasing_ref = f.functor;
this->functor = aliasing_ref;
It changes the GIMPLE from:
f1_2(D)->D.2297.functor = MEM[(const struct function
*)f2_3(D)].D.2297.functor;
to:
f1_2(D)->D.2297.functor = MEM[(const union function_buffer &
{ref-all})f2_3(D)];
Can I rely on that continuing to work? Is it likely to perform better than just
doing memcpy?
__builtin_memcpy(&this->functor, &f.functor, sizeof(f.functor));