summaryrefslogtreecommitdiff
path: root/compiler/cmm
diff options
context:
space:
mode:
authorMoritz Angermann <moritz@lichtzwerge.de>2014-10-21 15:33:18 -0500
committerAustin Seipp <austin@well-typed.com>2014-10-21 15:33:19 -0500
commit69f63612fc17cd6b3baaa8898c8595bde304ebfb (patch)
tree3172152d1a89abc1a60e0703ba7862668c5ae159 /compiler/cmm
parentc8199582ffe98fbfaef8e4aa036c748f8ec6b7ca (diff)
downloadhaskell-69f63612fc17cd6b3baaa8898c8595bde304ebfb.tar.gz
Fixes the ARM build
Summary: CodeGen.Platform.hs was changed with the following diff: -#endif globalRegMaybe _ = Nothing +#elif MACHREGS_NO_REGS +globalRegMaybe _ = Nothing +#else +globalRegMaybe = panic "globalRegMaybe not defined for this platform" +#endif which causes globalRegMaybe ot panic for arch ARM. This patch ensures globalRegMaybe is not called on ARM. Signed-off-by: Moritz Angermann <moritz@lichtzwerge.de> Test Plan: Building arm cross-compiler (e.g. --target=arm-apple-darwin10) Reviewers: hvr, ezyang, simonmar, rwbarton, austin Reviewed By: austin Subscribers: dterei, bgamari, simonmar, ezyang, carter Differential Revision: https://phabricator.haskell.org/D208 GHC Trac Issues: #9593
Diffstat (limited to 'compiler/cmm')
-rw-r--r--compiler/cmm/CmmSink.hs7
1 files changed, 5 insertions, 2 deletions
diff --git a/compiler/cmm/CmmSink.hs b/compiler/cmm/CmmSink.hs
index 4dced9afd2..22f4d2ec92 100644
--- a/compiler/cmm/CmmSink.hs
+++ b/compiler/cmm/CmmSink.hs
@@ -10,6 +10,7 @@ import CmmLive
import CmmUtils
import Hoopl
import CodeGen.Platform
+import Platform (isARM, platformArch)
import DynFlags
import UniqFM
@@ -235,8 +236,10 @@ isSmall _ = False
isTrivial :: DynFlags -> CmmExpr -> Bool
isTrivial _ (CmmReg (CmmLocal _)) = True
isTrivial dflags (CmmReg (CmmGlobal r)) = -- see Note [Inline GlobalRegs?]
- isJust (globalRegMaybe (targetPlatform dflags) r)
- -- GlobalRegs that are loads from BaseReg are not trivial
+ if isARM (platformArch (targetPlatform dflags))
+ then True -- CodeGen.Platform.ARM does not have globalRegMaybe
+ else isJust (globalRegMaybe (targetPlatform dflags) r)
+ -- GlobalRegs that are loads from BaseReg are not trivial
isTrivial _ (CmmLit _) = True
isTrivial _ _ = False