Thread overview
Wrong stats of `pragma(inline, true)`-functions when compiling with `-cov` flag
Aug 02, 2020
Per Nordlöw
Aug 02, 2020
Per Nordlöw
Aug 02, 2020
Stefan Koch
Aug 02, 2020
Per Nordlöw
Aug 02, 2020
Per Nordlöw
Aug 02, 2020
Per Nordlöw
August 02, 2020
I've noticed that the results of

    dmd -cov

are incorrect for inline-functions such as

void f()
{
    pragma(inline, true);
    ...
}

eventhough I feed `dmd` neither the `-O` nor `-inline` nor `-release` flag.

The problem goes away when I remove the `pragma(inline, true)`-directives from the affected function.

Is this a know issue?
August 02, 2020
On Sunday, 2 August 2020 at 11:15:53 UTC, Per Nordlöw wrote:
> The problem goes away when I remove the `pragma(inline, true)`-directives from the affected function.

In the meanwhile I can elide this issue via

    version(D_Coverage) {} else pragma(inline, true);

in-place of

    pragma(inline, true);

.
August 02, 2020
On Sunday, 2 August 2020 at 11:15:53 UTC, Per Nordlöw wrote:
> I've noticed that the results of
>
>     dmd -cov
>
> are incorrect for inline-functions such as
>
> void f()
> {
>     pragma(inline, true);
>     ...
> }
>
> eventhough I feed `dmd` neither the `-O` nor `-inline` nor `-release` flag.
>
> The problem goes away when I remove the `pragma(inline, true)`-directives from the affected function.
>
> Is this a know issue?

Well the inliner is now active even without the inline flag.

If you use an older compiler the issue goes away.

August 02, 2020
On Sunday, 2 August 2020 at 12:06:48 UTC, Stefan Koch wrote:
> Well the inliner is now active even without the inline flag.
>
> If you use an older compiler the issue goes away.

Ok, thanks.

For reference see

https://forum.dlang.org/thread/lhmfyondzdniusvhjxzp@forum.dlang.org
August 02, 2020
On Sunday, 2 August 2020 at 12:06:48 UTC, Stefan Koch wrote:
> Well the inliner is now active even without the inline flag.
>
> If you use an older compiler the issue goes away.

AFAICT, inlining triggered by

    pragma(inline, true);

should be disabled when the `-cov` flag is given.

Right?
August 02, 2020
On Sunday, 2 August 2020 at 12:50:33 UTC, Per Nordlöw wrote:
> AFAICT, inlining triggered by
>
>     pragma(inline, true);
>
> should be disabled when the `-cov` flag is given.
>
> Right?

Can you take a look at

https://github.com/dlang/dmd/pull/11490

Stefan Koch?