Bug 21822 – Optimizer flowlv() does not account for OPmemcmp and OPstrcmp

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2021-04-12T10:03:28Z
Last change time
2021-04-12T11:13:30Z
Keywords
backend, pull, wrong-code
Assigned to
No Owner
Creator
Walter Bright

Comments

Comment #0 by bugzilla — 2021-04-12T10:03:28Z
The following: char[4] sun(); bool moon() { auto a = sun(); auto b = sun(); return a == b; // generates OPmemcmp } may be incorrectly compiled when optimized because the flowlv() function in the optimizer does not account for the OPmemcmp or OPstrcmp intermediate code operators. This problem was exposed by https://github.com/dlang/dmd/pull/12409
Comment #1 by dlang-bot — 2021-04-12T10:10:58Z
@WalterBright created dlang/dmd pull request #12427 "fix Issue 21822 - Optimizer flowlv() does not account for OPmemcmp an…" fixing this issue: - fix Issue 21822 - Optimizer flowlv() does not account for OPmemcmp and OPstrcmp https://github.com/dlang/dmd/pull/12427
Comment #2 by dlang-bot — 2021-04-12T11:13:30Z
dlang/dmd pull request #12427 "fix Issue 21822 - Optimizer flowlv() does not account for OPmemcmp an…" was merged into master: - a7d0f6424d80e6cccba083d138eff417d8aecd5f by Walter Bright: fix Issue 21822 - Optimizer flowlv() does not account for OPmemcmp and OPstrcmp https://github.com/dlang/dmd/pull/12427