digitalmars.D.bugs - [Issue 7734] New: Wrong comparison of float return value from opEquals
- d-bugmail puremagic.com (34/34) Mar 19 2012 http://d.puremagic.com/issues/show_bug.cgi?id=7734
- d-bugmail puremagic.com (10/10) Mar 20 2012 http://d.puremagic.com/issues/show_bug.cgi?id=7734
- d-bugmail puremagic.com (11/11) Mar 21 2012 http://d.puremagic.com/issues/show_bug.cgi?id=7734
http://d.puremagic.com/issues/show_bug.cgi?id=7734 Summary: Wrong comparison of float return value from opEquals Product: D Version: D2 Platform: All OS/Version: All Status: NEW Severity: normal Priority: P2 Component: DMD AssignedTo: nobody puremagic.com ReportedBy: simen.kjaras gmail.com --- Comment #0 from Simen Kjaeraas <simen.kjaras gmail.com> 2012-03-19 10:57:24 PDT --- struct Foo { float opEquals(int other) { return 0.0; } } void main( ) { assert( Foo() != 3 ); } The above code generates this assembly: fldz fucompp fnstsw ax sahf je D main+25h mov eax,0Ah call main __assert It seems to assume that FPU status flags will be all 0 when the return value is 0.0, which is simply not true - the C3 flag is 1 when the return value is 0.0. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Mar 19 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7734 yebblies <yebblies gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |yebblies gmail.com --- Comment #1 from yebblies <yebblies gmail.com> 2012-03-21 16:45:49 EST --- Huh? Isn't it just loading the fpu status bits then branching if not equal? -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Mar 20 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7734 Simen Kjaeraas <simen.kjaras gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |INVALID --- Comment #2 from Simen Kjaeraas <simen.kjaras gmail.com> 2012-03-21 08:44:51 PDT --- Yups. My brain was somewhere else when I filed this. Closing it as invalid. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Mar 21 2012