Bug 17917 – Wrong code gen with "-O -cov"

Status
RESOLVED
Resolution
WORKSFORME
Severity
major
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2017-10-19T15:06:49Z
Last change time
2019-11-28T12:36:40Z
Assigned to
No Owner
Creator
Mihails Strasuns

Comments

Comment #0 by mihails.strasuns.contractor — 2017-10-19T15:06:49Z
This function https://github.com/sociomantic-tsunami/ocean/blob/v3.0.0/src/ocean/core/array/Search.d#L1272-L1290 starts to fail test when compiled with "-O -cov" (both flags matter). Investigation shows that it doesn't do early return after first conditon of `&&` expression fails, as demanded by spec. However, the very same function and test don't fail when compiled alone, outside of whole ocean codebase. I don't have smaller reproducible test case yet.
Comment #1 by bugzilla — 2019-11-28T12:36:40Z
While I could reproduce the error with dmd 2.082 (-cov was not needed), with the current version it seems to be gone.