April 29, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=5908


kennytm@gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|Optimizer generates wrong   |Optimizer generates wrong
                   |value with floating-point   |value with divide-by-zero.
                   |divide-by-zero.             |


--- Comment #1 from kennytm@gmail.com 2011-04-29 00:36:35 PDT ---
Actually the whole divide-by-zero scene is broken. With integers this should raise a Floating Point Exception, but instead it is set to the address of some variable in the backend.

---------------------------------------------
import std.stdio;
void main() {
    int a = 1;
    int b = 0;
    int c = a/b;
    writefln("%x", c);
}
---------------------------------------------
$ dmd x
$ ./x
Floating point exception
$ dmd -O x
$ ./x
9a9d34
---------------------------------------------

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
May 05, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=5908


jens.k.mueller@gmx.de changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jens.k.mueller@gmx.de


--- Comment #2 from jens.k.mueller@gmx.de 2011-05-05 15:03:25 PDT ---
I would have expected that
-----------------------------------------
import std.math, std.conv;
void main() {
    float c = 1.0f/0.0f;
    assert(!isFinite(c), to!string(c));
}
-----------------------------------------
fails, too.
But it doesn't.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------