digitalmars.D.bugs - [Issue 19333] New: Add float, double and real overloads over
- d-bugmail puremagic.com (31/31) Oct 25 2018 https://issues.dlang.org/show_bug.cgi?id=19333
https://issues.dlang.org/show_bug.cgi?id=19333 Issue ID: 19333 Summary: Add float, double and real overloads over volatileLoad and volatileStore Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: enhancement Priority: P1 Component: dmd Assignee: nobody puremagic.com Reporter: ibuclaw gdcproject.org These might be useful for the buggy std.math tests where clever compilers don't raise FE flags if it is able to const-fold the value at compile time - such as GDC or LDC For example, the following test returns false for `ieeeFlags.inexact` with optimizations on. ``` () { x = 1; x += 0.1; }, () => ieeeFlags.inexact ``` So we would benefit from instead writing it as: ``` () { volatileStore(&x, 1); volatileStore(&x, x + 0.1); } () => ieeeFlags.inexact ``` Which should be guaranteed to be true if the compiler adheres to correct volatile semantics. --
Oct 25 2018