[GHC] #6156: Optimiser bug on linux-powerpc
GHC
cvs-ghc at haskell.org
Wed Aug 22 11:24:26 CEST 2012
#6156: Optimiser bug on linux-powerpc
------------------------------------------+---------------------------------
Reporter: erikd | Owner: igloo
Type: bug | Status: new
Priority: normal | Milestone: 7.6.1
Component: Compiler | Version: 7.4.1
Resolution: | Keywords:
Os: Linux | Architecture: powerpc
Failure: Incorrect result at runtime | Difficulty: Unknown
Testcase: | Blockedby:
Blocking: | Related:
------------------------------------------+---------------------------------
Comment(by simonmar):
Replying to [comment:38 erikd]:
> foreign import ccall "c_printInt64" printInt64 :: CLLong -> IO ()
Add "unsafe" here to make the generated code simpler.
> main :: IO ()
> main = do
> printInt64 input
> putStrLn (showHex input "")
suggest getting rid of the `putStrLn`, again to make things simpler.
> and compiled without optimisation I get:
>
> {{{
> 1a2a3a4a5a6a7a8a
> 1a2a3a4a5a6a7a8a
> }}}
>
> and with optimisation I get:
>
> {{{
> 7a8a
> 1a2a3a4a5a6a7a8a
> }}}
>
> which is weird in that the FFI version is incorrect, but only when
optimisation is off.
Did you mean to say ''on'' here?
> This suggests that its actually a problem with the way 64 bit values are
passed to functions.
Yes, probably.
So now you have a very simple example that generates incorrect code and
doesn't call any library functions, the bug must be somewhere in the
generated code for this module. Compile it with -S and eyeball the
assembly code.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/6156#comment:39>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the Glasgow-haskell-bugs
mailing list