summaryrefslogtreecommitdiff
path: root/compiler/codeGen
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/codeGen')
-rw-r--r--compiler/codeGen/CgCon.lhs8
-rw-r--r--compiler/codeGen/StgCmmCon.hs8
2 files changed, 15 insertions, 1 deletions
diff --git a/compiler/codeGen/CgCon.lhs b/compiler/codeGen/CgCon.lhs
index 89a4e84400..36c851d5ba 100644
--- a/compiler/codeGen/CgCon.lhs
+++ b/compiler/codeGen/CgCon.lhs
@@ -165,7 +165,13 @@ which is guaranteed in range.
Because of this, we use can safely return an addressing mode.
+We don't support this optimisation when compiling into Windows DLLs yet
+because they don't support cross package data references well.
+
\begin{code}
+
+
+#if !(defined(__PIC__) && defined(mingw32_HOST_OS))
buildDynCon binder _ con [arg_amode]
| maybeIntLikeCon con
, (_, CmmLit (CmmInt val _)) <- arg_amode
@@ -187,6 +193,8 @@ buildDynCon binder _ con [arg_amode]
-- CHARLIKE closures consist of a header and one word payload
charlike_amode = CmmLit (cmmLabelOffW charlike_lbl offsetW)
; returnFC (taggedStableIdInfo binder charlike_amode (mkConLFInfo con) con) }
+#endif
+
\end{code}
Now the general case.
diff --git a/compiler/codeGen/StgCmmCon.hs b/compiler/codeGen/StgCmmCon.hs
index 452a352bab..18c2509ccd 100644
--- a/compiler/codeGen/StgCmmCon.hs
+++ b/compiler/codeGen/StgCmmCon.hs
@@ -147,8 +147,13 @@ work with any old argument, but for @Int@-like ones the argument has
to be a literal. Reason: @Char@ like closures have an argument type
which is guaranteed in range.
-Because of this, we use can safely return an addressing mode. -}
+Because of this, we use can safely return an addressing mode.
+We don't support this optimisation when compiling into Windows DLLs yet
+because they don't support cross package data references well.
+-}
+
+#if !(defined(__PIC__) && defined(mingw32_HOST_OS))
buildDynCon binder _cc con [arg]
| maybeIntLikeCon con
, StgLitArg (MachInt val) <- arg
@@ -172,6 +177,7 @@ buildDynCon binder _cc con [arg]
-- CHARLIKE closures consist of a header and one word payload
charlike_amode = cmmLabelOffW charlike_lbl offsetW
; return (litIdInfo binder (mkConLFInfo con) charlike_amode, mkNop) }
+#endif
-------- buildDynCon: the general case -----------
buildDynCon binder ccs con args