From 1414e10a1470061e850b7ce2aa6350a428ade2e9 Mon Sep 17 00:00:00 2001 From: "pho@cielonegro.org" Date: Sat, 8 May 2010 14:39:00 +0000 Subject: [PATCH] PIC support for PowerPC PPC.CodeGen.getRegister was not properly handling PicBaseReg. It seems working with this patch, but I'm not sure this change is correct. --- compiler/nativeGen/PPC/CodeGen.hs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/compiler/nativeGen/PPC/CodeGen.hs b/compiler/nativeGen/PPC/CodeGen.hs index 1215b2e..a1b55ce 100644 --- a/compiler/nativeGen/PPC/CodeGen.hs +++ b/compiler/nativeGen/PPC/CodeGen.hs @@ -377,6 +377,11 @@ iselExpr64 expr getRegister :: CmmExpr -> NatM Register +getRegister (CmmReg (CmmGlobal PicBaseReg)) + = do + reg <- getPicBaseNat archWordSize + return (Fixed archWordSize reg nilOL) + getRegister (CmmReg reg) = return (Fixed (cmmTypeSize (cmmRegType reg)) (getRegisterReg reg) nilOL) -- 1.7.10.4