[ ghc-Bugs-818425 ] Bad sparc Int64 code via NCG with -O
SourceForge.net
noreply at sourceforge.net
Fri Dec 17 04:42:35 EST 2004
Bugs item #818425, was opened at 2003-10-06 04:10
Message generated for change (Comment added) made by simonmar
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=108032&aid=818425&group_id=8032
Category: Compiler (NCG)
Group: 6.0.1
Status: Open
Resolution: None
>Priority: 3
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Nobody/Anonymous (nobody)
Summary: Bad sparc Int64 code via NCG with -O
Initial Comment:
On sparc machines ( sparc-sun-solaris2.6,
sparc-unknown-openbsd ) testsuite tests exercising
Int64 code are broken when compiled the optasm way.
This includes the arith011 test and the enum02 test,
possibly others. Trivial Int64 code will produce
erroneous results. Turning off optimisation, or
compiling via C, will generate correct code.
Some examples..
This one comes from enum02:
import Int
main = do print $ pred (1 :: Int64)
$ ./a.out
4294967295
which is UINT_MAX...
And from arith011, this generates incorrect results:
import Int
main = do print $ take 10 [ (0::Int64), toEnum 2 .. ]
on x86:
[0,2,4]
on sparc:
[0,8589934592,17179869184]
which is 2 * (UNIT_MAX + 1), and then twice that.
This erroneously generates an infinte sequence, filling
up /usr on my system before I realised what happened:
import Int
main = do print [ (0::Int64) .. toEnum 2 ]
-- Don Stewart
----------------------------------------------------------------------
>Comment By: Simon Marlow (simonmar)
Date: 2004-12-17 09:42
Message:
Logged In: YES
user_id=48280
Lowering priority; the native code generator in 6.4 doesn't
support sparc any more. Any volunteers?
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=108032&aid=818425&group_id=8032
More information about the Glasgow-haskell-bugs
mailing list