#7510: Immediate seg-fault on 32-bit windows build
    Reporter:  simonpj           |       Owner:  simonmar        
        Type:  bug               |      Status:  new             
    Priority:  highest           |   Milestone:  7.8.1           
   Component:  Compiler          |     Version:  7.6.1           
    Keywords:                    |          Os:  Unknown/Multiple
Architecture:  Unknown/Multiple  |     Failure:  None/Unknown    
  Difficulty:  Unknown           |    Testcase:                  
   Blockedby:                    |    Blocking:                  
     Related:                    |  

Comment(by marlowsd@…):

 commit 03d360f289a1c7e93fedf8cfa274cbe5929cd32c
 Author: Simon Marlow <marlo...@gmail.com>
 Date:   Mon Jan 7 12:26:29 2013 +0000

     Fix bugs in allocMoreStack (#7498, #7510)

     There were four bugs here.  Clearly I didn't test this enough to
     expose the bugs - it appeared to work on x86/Linux, but completely by
     accident it seems.

     1. the delta was wrong by a factor of the slot size (as noted on

     2. we weren't correctly aligning the stack pointer (sp needs to be
     16-byte aligned on x86/x86_64)

     3. we were doing the adjustment multiple times in the case of a block
     that was both a return point and a local branch target.  To fix this I
     had to add new shim blocks to adjust the stack pointer, and retarget
     the original branches.  See comment for details.

     4. we were doing the adjustment for CALL instructions, which is
     unnecessary and wrong; only JMPs should be preceded by a stack

     (Someone with a PPC box will need to update the PPC version of
     allocMoreStack to fix the above bugs, using the x86 version as a

  compiler/nativeGen/AsmCodeGen.lhs |   10 ++--
  compiler/nativeGen/PPC/Instr.hs   |    7 +-
  compiler/nativeGen/X86/Instr.hs   |  124
  3 files changed, 99 insertions(+), 42 deletions(-)

Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/7510#comment:13>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler

Glasgow-haskell-bugs mailing list

Reply via email to