Bug 23990 – constant folding of integer casts not always happening in front end
Status
RESOLVED
Resolution
INVALID
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2023-06-14T01:02:40Z
Last change time
2023-06-15T01:39:02Z
Keywords
pull
Assigned to
No Owner
Creator
Walter Bright
Comments
Comment #0 by bugzilla — 2023-06-14T01:02:40Z
It gets deferred until conversion to the intermediate code, unless CTFE is also run. This causes:
1. some inconsistencies in the expressions after semantic analysis
2. some high level optimizations to be missed
3. constant folding passes to get unnecessarily re-run
Comment #1 by dlang-bot — 2023-06-14T01:05:40Z
@WalterBright created dlang/dmd pull request #15322 "fix Issue 23990 - constant folding of integer casts not always happen…" fixing this issue:
- fix Issue 23990 - constant folding of integer casts not always happening in front end
https://github.com/dlang/dmd/pull/15322