C++ PATCH for c++/84978, ICE with NRVO

Jason Merrill jason@redhat.com
Tue Mar 20 18:11:00 GMT 2018


On Tue, Mar 20, 2018 at 11:55 AM, Jason Merrill <jason@redhat.com> wrote:
> On Tue, Mar 20, 2018 at 9:32 AM, Marek Polacek <polacek@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.

Thus.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: callee-nofold.diff
Type: text/x-patch
Size: 3196 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20180320/c4452fda/attachment.bin>


More information about the Gcc-patches mailing list