[Issue 5908] Optimizer generates wrong value with divide-by-zero.

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Apr 29 00:40:20 PDT 2011


http://d.puremagic.com/issues/show_bug.cgi?id=5908


kennytm at 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 at 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: -------


More information about the Digitalmars-d-bugs mailing list