Did Walter's pure optimization ever make it into dmd?

Dennis dkorpel at gmail.com
Tue Apr 3 08:19:35 UTC 2018


On Monday, 2 April 2018 at 11:33:29 UTC, ag0aep6g wrote:
> On 04/02/2018 10:52 AM, Dennis wrote:
> The function also needs the `nothrow` attribute. And you have 
> to compile with `-O -release`.

Aha, I presume the release flag is necessary in case there is a 
`debug {writeln("...");}` in the function. Is there a list of 
things the -release flag changes?
There's only a brief description here: 
https://dlang.org/dmd-windows.html
And it seems like there are a lot more subtle differences.

Also, I wonder why it has to be nothrow. In which cases does it 
make a difference? I think these two are identical for example:

try {int x = sqrt(-1) + sqrt(-1)}
catch (ArithmeticException e) {}

try {int x = 2*sqrt(-1)}
catch (ArithmeticException e) {}



More information about the Digitalmars-d mailing list