diff options
author | Simon Marlow <marlowsd@gmail.com> | 2013-02-11 10:50:45 +0000 |
---|---|---|
committer | Simon Marlow <marlowsd@gmail.com> | 2013-02-11 10:50:45 +0000 |
commit | e19a20488b5b7b412543fb81b81ee9412ef414e6 (patch) | |
tree | 2bda86932f170b17ccc62dafa850c116294f93cd /compiler/nativeGen/X86/Instr.hs | |
parent | 36d9ded20c07f6b81271fa248e301cc44f29eff7 (diff) | |
download | haskell-e19a20488b5b7b412543fb81b81ee9412ef414e6.tar.gz |
allocMoreStack: we should be retargetting table jumps too.
Thanks to @PHO on #7498 for pointing this out.
Diffstat (limited to 'compiler/nativeGen/X86/Instr.hs')
-rw-r--r-- | compiler/nativeGen/X86/Instr.hs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/nativeGen/X86/Instr.hs b/compiler/nativeGen/X86/Instr.hs index 504d953303..76f0e8bd91 100644 --- a/compiler/nativeGen/X86/Instr.hs +++ b/compiler/nativeGen/X86/Instr.hs @@ -39,6 +39,7 @@ import Unique import UniqSupply import Control.Monad +import Data.Maybe (fromMaybe) -- Size of an x86/x86_64 memory address, in bytes. -- @@ -900,9 +901,8 @@ allocMoreStack platform slots (CmmProc info lbl live (ListGraph code)) = do insert_dealloc insn r = case insn of JMP _ _ -> dealloc : insn : r JXX_GBL _ _ -> panic "insert_dealloc: cannot handle JXX_GBL" - JXX cond b | Just new_dest <- mapLookup b new_blockmap - -> JXX cond new_dest : r - _ -> insn : r + _other -> x86_patchJumpInstr insn retarget : r + where retarget b = fromMaybe b (mapLookup b new_blockmap) new_code = concatMap insert_stack_insns code -- in |