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

--- Comment #4 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
This ICE apparently depends on whether we perform NRVO or not.  If the size of
S is <=16B we pass it in registers and it compiles fine.  But if the size of S
is >16B, then we pass in memory, and we NRV-optimize.  That means that
s.fn ();
is after finalize_nrv
<retval>.fn ();

Then the newly added call to cp_get_callee_fndecl in cp_genericize_r calls
maybe_constant_init, which ends up evaluating <retval>, but it's not in the
hash map, so we crash here:
4111       /* We ask for an rvalue for the RESULT_DECL when indirecting
4112          through an invisible reference, or in named return value
4113          optimization.  */
4114       return (*ctx->values->get (t));

Reply via email to