On Thursday, 31 July 2014 at 07:47:51 UTC, Walter Bright wrote:
On 7/30/2014 4:51 PM, Tobias Müller wrote:
With relatively 'dumb' compilers, this is not a big problem, but optimizers are more and more clever and will take profit of such assumptions if they
can.

If D wishes to be competitive, it must go down that path.

If you, as a user, do not wish this behavior, then do not use -release.

The documentation for -release says:

"compile release version, which means not generating code for contracts and asserts. Array bounds checking is not done for system and trusted functions."

https://dlang.org/dmd-windows.html

It's worth noting that ldc (and gdc maybe, can't remember) offer some finer control over what does/doesn't get eliminated, e.g. -enable-contracts -disable-asserts etc.

Reply via email to