#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 ChrisKuklewicz):
Here is a patch to compiler/nativeGen/MachineCodeGen.hs to use the desired
instructions:
{{{
--- MachCodeGen-orig.hs 2007-11-28 00:09:25.000000000 +0000
+++ MachCodeGen-cek.hs 2007-11-28 00:08:48.000000000 +0000
@@ -1746,7 +1746,7 @@
CmmStaticLit (CmmFloat f frep)]
`consOL` (addr_code `snocOL` LD frep dst addr)
return (Any frep code)
-
+{-
getRegister (CmmLit lit)
= let rep = cmmLitRep lit
imm = litToImm lit
@@ -1755,6 +1755,17 @@
OR dst dst (RIImm (LO imm))
]
in return (Any rep code)
+-}
+
+getRegister (CmmLit lit)
+ = let rep = cmmLitRep lit
+ imm = litToImm lit
+ code dst = toOL [
+ LIS dst (HA imm),
+ ADD dst dst (RIImm (LO imm))
+ ]
+ in return (Any rep code)
+-}
getRegister other = pprPanic "getRegister(ppc)" (pprExpr other)
}}}
More testing is needed, but I think I have a working stage2 compiler from
the above without having to use -fvia-C.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/1843#comment:21>
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