[PATCH] make UNREG build as a platform with 0 hardware registers

slyich at gmail.com slyich at gmail.com
Thu May 1 10:03:22 UTC 2014


From: Sergei Trofimovich <slyfox at gentoo.org>

83a003fcaec93dbfd5b46837f2bf3353412b9877 introduced optimization
which likes to know if a reg is a hardware reg via 'globalRegMaybe':

But --enable-unregisterised does not define that function:

    ghc-stage1: panic! (the 'impossible' happened)
       (GHC version 7.9.20140419 for x86_64-unknown-linux):
             globalRegMaybe not defined for this platform

CC: Simon Marlow <marlowsd at gmail.com>
Signed-off-by: Sergei Trofimovich <slyfox at gentoo.org>
---
 includes/CodeGen.Platform.hs | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/includes/CodeGen.Platform.hs b/includes/CodeGen.Platform.hs
index 3d6dd41..1e7c17d 100644
--- a/includes/CodeGen.Platform.hs
+++ b/includes/CodeGen.Platform.hs
@@ -743,7 +743,11 @@ globalRegMaybe CurrentNursery           = Just (RealRegSingle REG_CurrentNursery
 # endif
 globalRegMaybe _                        = Nothing
 #else
+# ifdef NO_REGS
+globalRegMaybe _                        = Nothing
+# else
 globalRegMaybe = panic "globalRegMaybe not defined for this platform"
+# endif /* !NO_REGS */
 #endif
 
 freeReg :: RegNo -> FastBool
-- 
1.9.2



More information about the ghc-devs mailing list