[Issue 13998] New: Wrong code with -O -inline, loops, and taking address of double
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Sat Jan 17 17:26:03 PST 2015
https://issues.dlang.org/show_bug.cgi?id=13998
Issue ID: 13998
Summary: Wrong code with -O -inline, loops, and taking address
of double
Product: D
Version: D2
Hardware: x86_64
OS: All
Status: NEW
Keywords: wrong-code
Severity: regression
Priority: P1
Component: DMD
Assignee: nobody at puremagic.com
Reporter: thecybershadow at gmail.com
////////////////////////// test.d /////////////////////////
void main()
{
static ulong repr(double d) { return *cast(ulong*)&d; }
double[] arr = [3.0];
foreach (x; arr) assert(repr(arr[0]) == repr(arr[0]));
}
///////////////////////////////////////////////////////////
Assert is triggered when built with -m64 -O -inline.
Might not be reproducible 100% of the time.
Introduced in https://github.com/D-Programming-Language/dmd/pull/3620
--
More information about the Digitalmars-d-bugs
mailing list