ldc-developers/ldc — Issue #18: Hello world doesn't compile on -O3 or higher
Author: dsimcha
Created: 2011-11-12 00:50:23+00:00
State: open

Hello world program:

import std.stdio;

void main() {
writeln("Hello, world.");
}

Everything works if I only use -O2 optimization, but:

$ ldc2 -O3 test.d
/usr/local/include/d/phobos/std/math.d(327): Error: pure function 'cos' cannot call impure function 'llvm_cos'
/usr/local/include/d/phobos/std/math.d(327): Error: safe function 'cos' cannot call system function 'llvm_cos'
/usr/local/include/d/phobos/std/math.d(327): Error: llvm_cos is not nothrow
/usr/local/include/d/phobos/std/math.d(325): Error: function std.math.cos 'cos' is nothrow yet may throw