Hi all,

While working on ghc bug #5111 I found that a recent commit broke
the PowerPC backend that was at least partially working previously.

Without this patch ghc doesn't compile. With this patch I get on
PowerPC:

  OVERALL SUMMARY for test run started at Thu May 26 15:02:28 EST 2011
      2793 total tests, which gave rise to
     11198 test cases, of which
         0 caused framework failures
      2084 were skipped

      8151 expected passes
       275 expected failures
         0 unexpected passes
       688 unexpected failures

The unexpected failures above are nearly all related to the fact the
ghci is currently broken on PowerPc (#5111) and optllvm failures
(the LLVM backend is not currently working on PowerPC).

I've also tested the patch on linux-x86_64 where the validate results
are the same with or without this patch.

I would appreciate it if someone could apply this patch to the master
branch.

Cheers,
Erik
-- 
----------------------------------------------------------------------
Erik de Castro Lopo
http://www.mega-nerd.com/
>From fb91daa1239d4388fc2657907ac522afc46e88a7 Mon Sep 17 00:00:00 2001
From: Erik de Castro Lopo <[email protected]>
Date: Thu, 26 May 2011 18:38:11 +1000
Subject: [PATCH] Handle II8 Size value in PowerPC code generator.

---
 compiler/nativeGen/PPC/CodeGen.hs |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/compiler/nativeGen/PPC/CodeGen.hs b/compiler/nativeGen/PPC/CodeGen.hs
index c96badd..cfd7131 100644
--- a/compiler/nativeGen/PPC/CodeGen.hs
+++ b/compiler/nativeGen/PPC/CodeGen.hs
@@ -898,7 +898,7 @@ genCCall (CmmPrim MO_WriteBarrier) _ _
  = return $ unitOL LWSYNC
 
 genCCall target dest_regs argsAndHints
-  = ASSERT (not $ any (`elem` [II8,II16]) $ map cmmTypeSize argReps)
+  = ASSERT (not $ any (`elem` [II16]) $ map cmmTypeSize argReps)
         -- we rely on argument promotion in the codeGen
     do
         (finalStack,passArgumentsCode,usedRegs) <- passArguments
@@ -1038,6 +1038,7 @@ genCCall target dest_regs argsAndHints
 #endif
                 stackSlot = AddrRegImm sp (ImmInt stackOffset')
                 (nGprs, nFprs, stackBytes, regs) = case cmmTypeSize rep of
+                    II8 -> (1, 0, 4, gprs)
                     II32 -> (1, 0, 4, gprs)
 #if darwin_TARGET_OS
         -- The Darwin ABI requires that we skip a corresponding number of GPRs when
-- 
1.7.5.1

_______________________________________________
Cvs-ghc mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/cvs-ghc

Reply via email to