-
-
Notifications
You must be signed in to change notification settings - Fork 270
Open
Labels
Description
This code:
import std.math : abs;
void main()
{
double[2] v = [-1, 0];
double maxip = 0;
for (int d = 0; d < 2; d++)
{
double[2] w = [0, 1];
w[d] = 1;
double ip = v[0] * w[0] + v[1] * w[1];
if (abs(ip) > abs(maxip))
maxip = ip;
}
assert(maxip < 0);
}succeeds when compiled without options, which is expected. When compiled with -O1 the assertion trips.
LDC - the LLVM D compiler (1.41.0):
based on DMD v2.111.0 and LLVM 20.1.5
built with LDC - the LLVM D compiler (1.41.0)
Default target: x86_64-pc-windows-msvc
Host CPU: znver5