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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|redundant set-zero when     |DSE does not remove
                   |initiate a struct           |set-zero which is partial
                   |                            |redundant

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
here is a testcase which shows the problem with when either front-ends:
```
struct thresh_restart {
        int             *f0;
        int                     f1;
        int                     f2;
        int                     f3;
};

int arr[10];
void __attribute__((noinline)) foo(struct thresh_restart *p) {
    arr[0] = p->f3;
    arr[1] = p->f1;
}

void func(int *b) {
    struct thresh_restart tr = {};
    tr.f3 = 3;
    tr.f1 = 1;
    foo(&tr);
}
```

Reply via email to