http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58270

--- Comment #1 from Florian Weimer <fweimer at redhat dot com> ---
The compiler is free to assume that both i1 and i2 are zero and the first store
is dead (because this is the only valid array index).  So if the buggy()
function stores a value of 1.0 at mem.dmem[0] unconditionally, this is still
correct.

struct {
    double dmem[1]; /* Change to dmem[2] and the bug disappears */
} mem;

void buggy(int i1, int i2) {
    mem.dmem[i1] = 0.5;
    mem.dmem[i2] = 1.;
}

Reply via email to