blob: e7110992082059648edb4fc18cc8726f3bc828bc (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
From 1414e10a1470061e850b7ce2aa6350a428ade2e9 Mon Sep 17 00:00:00 2001
From: pho@cielonegro.org <unknown>
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 files changed, 5 insertions(+), 0 deletions(-)
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.4.1
|