[GHC] #7794: GHCi "Prelude.undefined" exceptions on ARM; ByteCodeItbls.mkJumpToAddr unimplemented
GHC
ghc-devs at haskell.org
Mon Aug 26 12:38:16 UTC 2013
#7794: GHCi "Prelude.undefined" exceptions on ARM; ByteCodeItbls.mkJumpToAddr
unimplemented
-------------------------------+---------------------------
Reporter: cjwatson | Owner:
Type: bug | Status: new
Priority: normal | Milestone: 7.8.1
Component: GHCi | Version: 7.6.2
Resolution: | Keywords:
Operating System: Linux | Architecture: arm
Type of failure: GHCi crash | Difficulty: Unknown
Test Case: | Blocked By:
Blocking: | Related Tickets:
-------------------------------+---------------------------
Comment (by RoboTux):
Replying to [comment:4 RoboTux]:
> Inlining the call of the cacheflush system call (the call behind
{{{__clear_cache}}}) should work but it means the cache would be flush
every time mkJumpToAddr is called. I don't know enough the context of the
code generation but if that function is called several time after 1 code
generation then it's suboptimal. The patch then become:
>
>
> {{{
> +#elif arm_TARGET_ARCH
> +type ItblCode = Word32
> +mkJumpToAddr a
> + = [ 0xe92d0080 -- push {r7}
> + , 0xe3a0780f -- mov r7, #983040 ; 0xf0000
> + , 0xe2877002 -- add r7, r7, #2
> + , 0xe3a02000 -- mov r2, #0
> + , 0xef000000 -- swi 0x0
> + , 0xe8bd0080 -- pop {r7}
> + , 0xe51ff004 -- ldr pc, [pc, #-4] # pc reads as <current
insn>+8
> + , fromIntegral (ptrToInt a) ]
> }}}
I tried the patch on a Debian arm porterbox and it seems to work as no
exception was raised with it while an exception was raised without it.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/7794#comment:5>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list