Four bugs!  That must be some kind of record for a single ticket. Well fixed!

Yes, works for me now. Thank you.

Simon

| -----Original Message-----
| From: cvs-ghc-boun...@haskell.org [mailto:cvs-ghc-boun...@haskell.org]
| On Behalf Of Simon Marlow
| Sent: 07 January 2013 15:53
| To: cvs-ghc@haskell.org
| Subject: [commit: ghc] master: Fix bugs in allocMoreStack (#7498, #7510)
| (03d360f)
| 
| Repository : ssh://darcs.haskell.org//srv/darcs/ghc
| 
| On branch  : master
| 
| http://hackage.haskell.org/trac/ghc/changeset/03d360f289a1c7e93fedf8cfa2
| 74cbe5929cd32c
| 
| >---------------------------------------------------------------
| 
| 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
| #7498)
| 
|     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
|     adjustment.
| 
|     (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
|     guide.)
| 
|  compiler/nativeGen/AsmCodeGen.lhs |   10 ++--
|  compiler/nativeGen/PPC/Instr.hs   |    7 +-
|  compiler/nativeGen/X86/Instr.hs   |  124 +++++++++++++++++++++++++++---
| -------
|  3 files changed, 99 insertions(+), 42 deletions(-)
| 
| 
| Diff suppressed because of size. To see it, use:
| 
|     git show 03d360f289a1c7e93fedf8cfa274cbe5929cd32c
| 
| _______________________________________________
| Cvs-ghc mailing list
| Cvs-ghc@haskell.org
| http://www.haskell.org/mailman/listinfo/cvs-ghc

_______________________________________________
Cvs-ghc mailing list
Cvs-ghc@haskell.org
http://www.haskell.org/mailman/listinfo/cvs-ghc

Reply via email to