www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Wrong stats of `pragma(inline, true)`-functions when compiling with

reply Per =?UTF-8?B?Tm9yZGzDtnc=?= <per.nordlow gmail.com> writes:
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?
Aug 02 2020
next sibling parent Per =?UTF-8?B?Tm9yZGzDtnc=?= <per.nordlow gmail.com> writes:
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); .
Aug 02 2020
prev sibling parent reply Stefan Koch <uplink.coder googlemail.com> writes:
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.
Aug 02 2020
next sibling parent Per =?UTF-8?B?Tm9yZGzDtnc=?= <per.nordlow gmail.com> writes:
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
Aug 02 2020
prev sibling parent reply Per =?UTF-8?B?Tm9yZGzDtnc=?= <per.nordlow gmail.com> writes:
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?
Aug 02 2020
parent Per =?UTF-8?B?Tm9yZGzDtnc=?= <per.nordlow gmail.com> writes:
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?
Aug 02 2020