Bug 24185 – Constant folding differs between Windows and linux builds

Status
NEW
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2023-10-13T16:14:02Z
Last change time
2024-12-13T19:31:06Z
Assigned to
No Owner
Creator
timon.gehr
Moved to GitHub: dmd#20339 →

Comments

Comment #0 by timon.gehr — 2023-10-13T16:14:02Z
DMD 2.105.2: --- void main(){ import std.stdio; assert(42*6==252); assert(cast(int)(4.2*60)==251); // passes on linux, fails on windows double x=4.2; assert(cast(int)(x*60)==252); // passes on both } --- Constant folding/CTFE of floating-point code differs between compile time and runtime, and it differs even between platforms.
Comment #1 by robert.schadek — 2024-12-13T19:31:06Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/20339 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB