
#10413: Incorrect offsets for array size indexing -------------------------------------+------------------------------------- Reporter: fryguybob | Owner: Type: task | Status: new Priority: low | Milestone: Component: Compiler | Version: 7.10.1 (CodeGen) | Operating System: Unknown/Multiple Keywords: | Type of failure: Other Architecture: | Blocked By: Unknown/Multiple | Related Tickets: Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- There are several cases in the array code generation where a byte offset is used when a word offset is needed. For example ([https://git.haskell.org/ghc.git/blob/eb6ca851f553262efe0824b8dcbe64952de4963... context]): {{{#!hs emitPrimOp dflags [res] SizeofSmallArrayOp [arg] = emit $ mkAssign (CmmLocal res) (cmmLoadIndexW dflags arg (fixedHdrSizeW dflags + oFFSET_StgSmallMutArrPtrs_ptrs dflags) (bWord dflags)) }}} This only works because `oFFSET_StgSmallMutArrPtrs_ptrs dflags` is zero. I don't have time to fix this now, but I'm reporting it so it isn't forgotten. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10413 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler