[Issue 17464] ICE in cg87.c on arithmetic expression with real numbers
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Fri Jun 2 17:10:40 PDT 2017
https://issues.dlang.org/show_bug.cgi?id=17464
--- Comment #1 from Ivan Kazmenko <gassa at mail.ru> ---
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);
}
-----
--
More information about the Digitalmars-d-bugs
mailing list