#7498: panic : Register allocator: out of stack slots (need 147)
----------------------------------+-----------------------------------------
Reporter: erikd | Owner:
Type: bug | Status: new
Priority: high | Milestone: 7.8.1
Component: Compiler | Version: 7.7
Resolution: | Keywords:
Os: Unknown/Multiple | Architecture: powerpc
Failure: Building GHC failed | Difficulty: Unknown
Testcase: | Blockedby:
Blocking: | Related:
----------------------------------+-----------------------------------------
Comment(by marlowsd@…):
commit 03d360f289a1c7e93fedf8cfa274cbe5929cd32c
{{{
Author: Simon Marlow <[email protected]>
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(-)
}}}
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/7498#comment:9>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs