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

--- Comment #25 from Iain Buclaw <ibuclaw at gcc dot gnu.org> ---
(In reply to Iain Buclaw from comment #23)
> (In reply to Iain Buclaw from comment #22)
> >     pthis.msgBuf = buf;
> In D, this is an array copy assignment.
> 
> I've tried lowering this to `foreach (i; 0 .. 100) msgBuf[i] = buf[i]`, but
> that doesn't trigger the ICE.
Just realised that struct assignment would be the equivalent in C/C++.

Here is an equivalent that ICE's when compiled with `gcc-riscv64-linux-gnu -O1`
on s390x host.
---
struct char100
{
    char data[100];
};

struct s118248
{
    void **vtbl;
    struct char100 data;
};

void sink(struct char100 *buf);

struct s118248 *pr118248(struct s118248 *pthis)
{
    struct char100 buf;
    sink(&buf);
    pthis->data = buf;
    return pthis;
}
---

Reply via email to