[GHC] #10413: Incorrect offsets for array size indexing

GHC ghc-devs at haskell.org
Wed May 13 14:06:24 UTC 2015


#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/eb6ca851f553262efe0824b8dcbe64952de4963d:/compiler/codeGen/StgCmmPrim.hs#l426
 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


More information about the ghc-tickets mailing list