www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 17917] New: Wrong code gen with "-O -cov"

https://issues.dlang.org/show_bug.cgi?id=17917

          Issue ID: 17917
           Summary: Wrong code gen with "-O -cov"
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: major
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: mihails.strasuns.contractor sociomantic.com

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.

--
Oct 19 2017