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

Chris via Digitalmars-d digitalmars-d at puremagic.com
Mon Oct 13 02:17:59 PDT 2014


On Sunday, 12 October 2014 at 15:44:14 UTC, Lumi Pakkanen wrote:
> I'm creating a somewhat large hobby project with D. I'm 
> enjoying the ride so far. Unit tests and contract programming 
> have saved me from long bug hunts, but today I ran into a bug 
> that seems to be caused by the -O and -inline flags with dmd.
>
> Without the flags the program runs correctly, but -O produces 
> wrong results consistently and -inline seems to cause memory 
> corruption.
>
> Now my problem here is that the program has over 5000 lines of 
> code with interdependencies running everywhere so I'm not sure 
> if it's possible to come up with a neat small program that 
> demonstrates the problem for a bug report.
>
> What should I do? Am I stuck with not using -O and -inline for 
> now, hoping that things will improve in the future?

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.

Error executing command run: Program exited with code -11

or

Segmentation fault (core dumped)

I posted here a few months ago, but to no avail. I still haven't 
found the answer to the problem. As in your case, my project has 
become too big to just "try to trace the bug".


More information about the Digitalmars-d mailing list