[commit: ghc] master: allocMoreStack: we should be retargetting table jumps too. (e19a204)

Simon Marlow marlowsd at gmail.com
Mon Feb 11 13:30:12 CET 2013


Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/e19a20488b5b7b412543fb81b81ee9412ef414e6

>---------------------------------------------------------------

commit e19a20488b5b7b412543fb81b81ee9412ef414e6
Author: Simon Marlow <marlowsd at gmail.com>
Date:   Mon Feb 11 10:50:45 2013 +0000

    allocMoreStack: we should be retargetting table jumps too.
    
    Thanks to @PHO on #7498 for pointing this out.

>---------------------------------------------------------------

 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 504d953..76f0e8b 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





More information about the ghc-commits mailing list