Martin Nowak reports https://github.com/D-Programming-Language/dmd/pull/2561 :
Here is a reduced test case for the std.numeric failure.
bool normalize(double[] range, double sum = 1)
{
double s = 0;
// Step 1: Compute sum and length of the range
const length = range.length;
foreach (e; range)
{
s += e;
}
// Step 2: perform normalization
if (s == 0)
{
return false;
}
// The path most traveled
return true;
}
This generate wrong code for s == 0 . It reuses rdx where it previously loaded the content of the xmm register from the stack. You can compare the old (at line 35) and the new (at line 32) dissassembly.
If I remove the SFLexit flag from rtlsym.h it works, this seems to have some side-effect on the backend register usage.
Comment #1 by safety0ff.bugz — 2014-06-04T14:59:01Z
IIRC the both my local machine and the auto-tester did not benefit from removing SFLexit flag.