On Tue, Mar 20, 2018 at 9:32 AM, Marek Polacek <pola...@redhat.com> wrote:
> We started crashing on this test with r258592 which added cp_get_callee_fndecl
> in <case AGGR_INIT_EXPR> in cp_genericize_r.
>
> 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 turned by finalize_nrv into
> <retval>.fn ();
>
> Then the newly added call to cp_get_callee_fndecl calls maybe_constant_init,

Oops, I forgot that cp_get_callee_fndecl would call
maybe_constant_init, I was just using it to handle both CALL_EXPR and
AGGR_INIT_EXPR.  And in fact it looks like we don't really want that
for the other users, either.  I think I'll remove it.

> 2018-03-20  Marek Polacek  <pola...@redhat.com>
>
>         PR c++/84978
>         * constexpr.c (cxx_eval_constant_expression): Handle the case when
>         a RESULT_DECL isn't in the hash map.

But your patch is also good.  OK.

Jason

Reply via email to