globalRegMaybe and ARM

Ben Gamari bgamari.foss at
Wed Jul 23 18:32:21 UTC 2014

Hello Simon,

b0534f7 [1] and the subsequent reversion f0fcc41d7 touched
`includes/CodeGen.Platform.hs`, the former removing a panic in the case
of `globalRegMaybe` being undefined for a platform and replacing it with

Recently I've found that my ARM builds (with -fllvm) crash at this panic
whereas they did not as of the 7.8 release. Given that b0534f7 was
reverted this is no doubt due to another change that I haven't
identified yet. Do you have any idea what is happening here?

I'm currently attempting to build with a workaround setting
`globalRegMaybe _ = Nothing`, although this smells suspicously like what
would happen in the unregisterized case.

My other hypothesis is that MACHREGS_arm should be added to the

    #if MACHREGS_i386 || MACHREGS_x86_64 || MACHREGS_sparc || MACHREGS_powerpc
which smells more like what a registerised architecture should do and it
seems the requisite macros are defined for ARM in
`stg/MachRegs.h`. Whatever happens for ARM should probably
also happen for AArch64.

How should `globalRegMaybe` and `freeReg` be defined for platforms that
rely exclusively on the LLVM backend? Both ARM and AArch64 appear to be
doing the wrong thing at present.


- Ben

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 472 bytes
Desc: not available
URL: <>

More information about the ghc-devs mailing list