Consistent bugs with dmd -O -inline in a large project

OlaOst via Digitalmars-d digitalmars-d at puremagic.com
Mon Oct 13 07:28:49 PDT 2014


On Monday, 13 October 2014 at 13:11:13 UTC, Gary Willoughby wrote:
> On Monday, 13 October 2014 at 09:18:01 UTC, Chris wrote:
>> I have the same problem. If I don't use -O it works fine 
>> (-inline is ok). If I use it, I get an error when executing 
>> the program.
>
> I had the same about a year ago, thought i was going crazy and 
> refactored the program and it went away. Never did find out 
> what was causing it.

Here too. I just managed to pare it down to 2 files:

-- main.d --
import std.algorithm;
import failsinline;

void main()
{
   auto fail = new FailsInline();
}
-- main.d --

-- failsinline.d --
import std.algorithm;
import std.array;

void failsinline()
{
   auto transform = (int i) => i;
   [0].map!transform.array;
}
-- failsinline.d --

'rdmd main.d' works fine.
'rdmd -inline main.d' gives object.Error@(0): Access Violation.

Removing the std.algorithm import from main.d makes it work fine.

Same issue in dmd 2.066, 2.066-rc2 and 2.067-b1.


More information about the Digitalmars-d mailing list