Opened 5 years ago

Closed 4 years ago

#10413 closed task (fixed)

Incorrect offsets for array size indexing

Reported by: fryguybob Owned by: fryguybob
Priority: low Milestone: 7.10.3
Component: Compiler (CodeGen) Version: 7.10.1
Keywords: Cc: simonmar, ekmett
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Other Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s): Phab:D1194
Wiki Page:

Description

There are several cases in the array code generation where a byte offset is used when a word offset is needed. For example (context):

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.

Change History (7)

comment:1 Changed 4 years ago by ekmett

Cc: ekmett added

comment:2 Changed 4 years ago by fryguybob

Owner: set to fryguybob

comment:3 Changed 4 years ago by fryguybob

Differential Rev(s): Phab:D1194

comment:4 Changed 4 years ago by Ben Gamari <ben@…>

In 010e187/ghc:

Fix trac #10413

Test Plan: Validate.

Reviewers: austin, tibbe, bgamari

Reviewed By: tibbe, bgamari

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D1194

GHC Trac Issues: #10413

comment:5 Changed 4 years ago by bgamari

Status: newmerge

comment:6 Changed 4 years ago by thoughtpolice

Milestone: 7.10.3

comment:7 Changed 4 years ago by bgamari

Resolution: fixed
Status: mergeclosed

Merged to ghc-7.10.

Note: See TracTickets for help on using tickets.