[Issue 14829] [REG2.066.0] wrong code with -O -inline

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Mon Jul 27 12:46:20 PDT 2015


https://issues.dlang.org/show_bug.cgi?id=14829

--- Comment #5 from Walter Bright <bugzilla at digitalmars.com> ---
Even smaller:

int stripLeft(int str, int dc)
{
    while (true)
    {
        int a = str;
        int s = a;
        str += 1;
        if (dc) return s;
    }
}

void main ()
{
    assert (stripLeft(3, 1) == 3); // fails with -O
}

--


More information about the Digitalmars-d-bugs mailing list