[Issue 5239] optimizer misreports an used before set error

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Aug 3 00:06:45 PDT 2011


http://d.puremagic.com/issues/show_bug.cgi?id=5239



--- Comment #1 from Brad Roberts <braddr at puremagic.com> 2011-08-03 00:06:43 PDT ---
Part of the test case for bug 6293 triggers this bug when built with -O.  See
runnable/xtet46.d, test6293().  The buggy part is hidden behind version(none).

class C6293 {
    C6293 token;
}
void f6293(in C6293[] a) pure {
    auto x0 = a[0].token;
    assert(x0 is a[0].token.token.token);
    assert(x0 is (&x0).token);
    version(none) {
        auto p1 = &x0 + 1;
        assert(x0 is (p1 - 1).token);
    }
    int c = 0;
    assert(x0 is a[c].token);
}
void test6293() {
    auto x = new C6293;
    x.token = x;
    f6293([x]);
}

See also:
  https://github.com/D-Programming-Language/dmd/pull/243

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list