[PATCH] make UNREG build as a platform with 0 hardware registers
Peter Trommler
ptrommler at me.com
Sun May 4 09:18:39 UTC 2014
Ticket #9055 has a patch that uses the MACHREGS_NO_REGS macro
coming from compiler/codeGen/Platform/NoRegs.hs.
I think globalRegMaybe should depend on the target platform of the code to be generated
and not on the host platform. Using the NO_REGS macro does the latter. I am thinking
of cross-compilation here, but I might be missing something major.
Peter
On 01 May 2014, at 12:03, slyich at gmail.com wrote:
> 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
>
> _______________________________________________
> ghc-devs mailing list
> ghc-devs at haskell.org
> http://www.haskell.org/mailman/listinfo/ghc-devs
More information about the ghc-devs
mailing list