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

--- Comment #12 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
(In reply to Jan Hubicka from comment #11)
> Sorry for the breakage.
> 
> Looking at Jakub's comment:
>   SR.11_24 = 0;
>   _12 = SR.11_24;
>   MEM <uint128_t> [(unsigned char * {ref-all})&nrvo] = _12;
>   nrvo = nrvo101273 (); [return slot optimization]
> instead of C++
>   nrvo = nrvo101273 (); [return slot optimization]
> 
> I think this may be the problem - we represent the call as full write and
> thus we do not expect
>   MEM <uint128_t> [(unsigned char * {ref-all})&nrvo] = _12;
> to survive.  We also do not expect the return slot argument to be read from
> - it should be write only and the write should correspond to the size of
> structure being initialized.

See above comments from Iain, even if that pre-initialization is removed it is
still miscompiled.  And, the testcase fails not because of the padding bits not
being zero, but because the address of self stored into one of the fields isn't
there or modref thinks it can't be changed or set to that.  But for
corresponding C++ it handles it ok.

Reply via email to