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


Don <clugd...@yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |clugd...@yahoo.com.au
            Summary|Cast of float function      |[DMC too] Cast of float
                   |return to ulong or uint     |function return to ulong or
                   |gives bogus value           |uint gives bogus value
           Severity|major                       |critical




--- Comment #3 from Don <clugd...@yahoo.com.au>  2009-08-01 03:04:42 PDT ---
This code below fails on DMC, proving that this is a severe back-end bug.
Interesting on DMC, the uint case does NOT fail: it inlines in that case.
Raising severity, as I believe this is one of the worse extant compiler bugs.

What's happening is that a function _DBLULNG@ is being used to convert from
double to ulong. It expects a double, but it's being given a float. So garbage
results.

#include <assert.h>
float getFloat() {
    return 5.0f;
}

int main()
{
   unsigned long j = (unsigned long)getFloat();
   assert(j==5);
   return 0;
}

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

Reply via email to