[GHC] #14677: Code generator does not correctly tag a pointer

GHC ghc-devs at haskell.org
Thu Jan 25 12:54:38 UTC 2018


#14677: Code generator does not correctly tag a pointer
-------------------------------------+-------------------------------------
        Reporter:  simonpj           |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.2.2
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:  14626
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by heisenbug):

 Replying to [comment:11 simonpj]:
 > Any progress, heisenbug?


 Sure! With my latest `git push wip/T14677` I have added a testcase (at GHC
 root directory for the interim), which shows that invoking a function with
 a `newtype Event = Event Int` argument now (with the patch applied)
 incorrectly assumes that `Event` constructor is passed '''unpacked'''.

 If you build the `ghc-stage1` on this branch and compile using `-O2`
 you'll get failures.
 With `-O0` the test passes, (as does `master` and `GHC-8.2.2`). So
 something is still wrong.

 In the buggy case the tagged pointer is checked at bit position 0 so the
 tagged `I#` constructor is being detected, but interpreted as an `Event` =
 `[evtRead]`.

 I don't understand enough about argument unpacking to resolve this. Maybe
 you can have a look?

 The `-g` problems above are a red herring, and probably another bug.
 Please disregard for now.

 I did not try defining `Event` locally yet, maybe that changes the
 situation.

-- 
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/14677#comment:12>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list