Bug 24553 – all 0 struct initializer with float is still stored in data section

Status
NEW
Severity
enhancement
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2024-05-16T23:08:16Z
Last change time
2024-12-13T19:35:16Z
Keywords
backend
Assigned to
No Owner
Creator
Steven Schveighoffer
Moved to GitHub: dmd#20455 →

Comments

Comment #0 by schveiguy — 2024-05-16T23:08:16Z
Consider these structs: ```d struct A { int[10000] x; } struct B { float[10000] x; } struct C { float[10000] x = 0; } struct D { char[10000] x = 0; } ``` A and D do not store any static data in the binary, because they are zero-initialized types (char.init is non-zero, but the assignment sets it to 0). B obviously must store static data because float.init is NaN. But C still stores static data (10000 32-bit 0s). This should not happen.
Comment #1 by robert.schadek — 2024-12-13T19:35:16Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/20455 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB