[commit: ghc] master: Fixes the ARM build (69f6361)

git at git.haskell.org git at git.haskell.org
Tue Oct 21 21:50:59 UTC 2014


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/69f63612fc17cd6b3baaa8898c8595bde304ebfb/ghc

>---------------------------------------------------------------

commit 69f63612fc17cd6b3baaa8898c8595bde304ebfb
Author: Moritz Angermann <moritz at lichtzwerge.de>
Date:   Tue Oct 21 15:33:18 2014 -0500

    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 at 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


>---------------------------------------------------------------

69f63612fc17cd6b3baaa8898c8595bde304ebfb
 compiler/cmm/CmmSink.hs | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/compiler/cmm/CmmSink.hs b/compiler/cmm/CmmSink.hs
index 4dced9a..22f4d2e 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
 



More information about the ghc-commits mailing list