Bug 15316 – struct float fields not correctly initialised on x64

Status
RESOLVED
Resolution
DUPLICATE
Severity
blocker
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
All
Creation time
2015-11-11T09:48:00Z
Last change time
2016-10-09T19:40:08Z
Assigned to
nobody
Creator
cauterite
Blocks
11135

Comments

Comment #0 by cauterite — 2015-11-11T09:48:58Z
http://dpaste.dzfl.pl/547374e4d630 struct A { float floo; }; void main() { A x = A.init; assert(x is x.init); // okay A y; assert(y is y.init); // fails }; Seems to work fine on x32, but fails on x64. Note that x64 codegen uses SSE, while x32 doesn't. doubles are also affected, but NOT reals: http://dpaste.dzfl.pl/b60adf79b79f
Comment #1 by hsteoh — 2016-02-17T13:34:41Z
Comment #2 by cauterite — 2016-08-19T21:48:02Z
*** Issue 16105 has been marked as a duplicate of this issue. ***
Comment #3 by cauterite — 2016-08-19T21:50:07Z
*** This issue has been marked as a duplicate of issue 9813 ***
Comment #4 by github-bugzilla — 2016-10-09T12:50:00Z
Commits pushed to stable at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/3bed8dfd33dffb40dc2fbb5850ebc26bccc3888f fix gdc-dmd test - remove the workound for Issue 15316 - we can't really solve Issue 15316 w/ signaling NaNs b/c any optimization, copying et.al. might turn signaling into quiet NaNs, therefor we want to solve Issue 15316 by switching Float.init to use quiet NaNs - the workaround depends on a specific dmd bug (see #6163) that looses SNaNs when writing struct initializers but keeps them for Float.init - this workaround might not be portable to GDC/LDC and will easily break w/ slightly different dmd optimizations (it's responsible for the test failure of the gdc-built dmd) - this PR will reopen https://issues.dlang.org/show_bug.cgi?id=11135 this partially reverts commit 0efa1d3bf92bcaa6c4a99cad0b574185a537906a https://github.com/dlang/phobos/commit/50a264628f411d41acec522e0f70fe6677ffd0c8 Merge pull request #4844 from MartinNowak/revert_3797 fix gdc-dmd test - remove the workound for Issue 15316
Comment #5 by github-bugzilla — 2016-10-09T19:40:08Z
Commits pushed to master at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/3bed8dfd33dffb40dc2fbb5850ebc26bccc3888f fix gdc-dmd test - remove the workound for Issue 15316 https://github.com/dlang/phobos/commit/50a264628f411d41acec522e0f70fe6677ffd0c8 Merge pull request #4844 from MartinNowak/revert_3797