#1843: ghc 6.8.1 broken on Mac OS X Leopard PPC
----------------------+-----------------------------------------------------
Reporter: guest | Owner:
Type: bug | Status: new
Priority: high | Milestone: 6.8.2
Component: Compiler | Version: 6.8.1
Severity: critical | Resolution:
Keywords: | Difficulty: Unknown
Testcase: | Architecture: powerpc
Os: MacOS X |
----------------------+-----------------------------------------------------
Comment (by thorkilnaur):
The following Haskell program {{{I3.hs}}} is a reduced version of
{{{Control/Monad/Instances.hs}}} that demonstrates the problem:
{{{
{-# OPTIONS_NHC98 --prelude #-}
module I3 (Monad(..)) where
import Prelude
instance Monad ((->) r) where
return = const
f >>= k = \ r -> k (f r) r
}}}
The attached tar.gz archive includes {{{I3.hs}}} as well as:
{{{I3.s}}}::
assembler code generated by the GHC native code generator
{{{I3.hc}}}::
C code generated by GHC with -fvia-C
{{{I3.raw_s}}}::
unmangled assembler code generated by {{{gcc}}} from {{{I3.hc}}}
{{{I3.mangled.s}}}::
mangled assembler code
{{{I3.asm.otool.out}}}::
dissection of the {{{.o}}} file corresponding to {{{I3.s}}}
{{{I3.C.otool.out}}}::
dissection of the {{{.o}}} file corresponding to {{{I3.mangled.s}}}
The otool dissection of the {{{.o}}} file corresponding to {{{I3.s}}}
generated by the GHC NCG indicates that the critical relocation happens in
the first of these lines from {{{I3.s}}}:
{{{
lis r31, hi16(_r6F_closure+3)
ori r31, r31, lo16(_r6F_closure+3)
stw r31, -12(r25)
}}}
The corresponding lines from {{{I3.mangled.s}}} seem to be these:
{{{
lis r2,ha16(_r6F_closure)
la r2,lo16(_r6F_closure)(r2)
addi r2,r2,3
stw r2,-12(r25)
}}}
Best regards
Thorkil
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/1843#comment:16>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs