|
RE: -fvia-c -O generates mal-typed C code (casts double via unsignedint): msg#00009lang.haskell.glasgow.bugs
On 07 August 2004 18:53, Duncan Coutts wrote: > The problem shows up as a double value loosing precision when it is > sent > to C land and back. It's because ghc generates C code that casts the > value via an unsigned word when it gets it back from C land. [ bug report snipped ] Thanks for an excellent report. I knew what the bug was without trying out the code. Unfortunately, it's not easily fixed. There's a part of the code generator that needs to get hold of some unique temporaries, and there isn't a supply of uniques to hand, so it always picks the same ones. This bug is already fixed in the new backend (which will be 6.4). I've committed a partial workaround for the bug to the HEAD, and will merge it into 6.2.2. The workaround fixes your program, but it will fail if you use 'safe' (instead of 'unsafe') ccalls. Fortunately, it also improves performance :-) Cheers, Simon
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | RE: Return signatures in case expressions, Simon Marlow |
|---|---|
| Next by Date: | [ ghc-Bugs-1002139 ] Assertion failed in GC.c, SourceForge.net |
| Previous by Thread: | -fvia-c -O generates mal-typed C code (casts double via unsigned int), Duncan Coutts |
| Next by Thread: | [ ghc-Bugs-710864 ] "entries" field is often 0, SourceForge.net |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |