Bug 19333 – Add float, double and real overloads over volatileLoad and volatileStore

Status
NEW
Severity
enhancement
Priority
P4
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2018-10-25T20:34:14Z
Last change time
2024-12-13T19:01:04Z
Assigned to
No Owner
Creator
Iain Buclaw
Moved to GitHub: dmd#19500 →

Comments

Comment #0 by ibuclaw — 2018-10-25T20:34:14Z
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.
Comment #1 by robert.schadek — 2024-12-13T19:01:04Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/19500 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB