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

--- Comment #1 from Ivan Kazmenko <[email protected]> ---
The compile line is just
dmd -main program.d
Actually, with -O, the function compiles fine.

Here is a slightly longer example to prevent optimizing the whole code away.
When compiled with `dmd -O`, it runs as expected.
However, compilation fails with just `dmd`:
-----
void fun (int x)
{
    auto a = [x];
    real v = a[0] * 1.0 / (a[0] ^^ 2);
    assert (v != 0.0);
}

void main ()
{
    import std.stdio;
    int v;
    readf (" %s", &v);
    fun (v);
}
-----

--

Reply via email to