[GHC] #13043: GHC 7.10->8.0 regression: GHC code-generates duplicate _closures

GHC ghc-devs at haskell.org
Thu Jan 5 08:52:25 UTC 2017


#13043: GHC 7.10->8.0 regression: GHC code-generates duplicate _closures
-------------------------------------+-------------------------------------
        Reporter:  hvr               |                Owner:
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:  8.0.3
       Component:  Compiler          |              Version:  8.0.2-rc2
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  Compile-time      |  Unknown/Multiple
  crash or panic                     |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:  #12595            |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by Simon Peyton Jones <simonpj@…>):

 In [changeset:"baf9ebe55a51827c0511b3a670e60b9bb3617ab5/ghc"
 baf9ebe5/ghc]:
 {{{
 #!CommitTicketReference repository="ghc"
 revision="baf9ebe55a51827c0511b3a670e60b9bb3617ab5"
 Ensure nested binders have Internal Names

 This is a long-standing bug.  A nested (non-top-level) binder
 in Core should not have an External Name, like M.x. But

 - Lint was not checking this invariant

 - The desugarer could generate programs that failed the
   invariant.  An example is in
   tests/deSugar/should_compile/T13043, which had
      let !_ = M.scState in ...
   This desugared to
      let ds = case M.scSate of M.scState { DEFAULT -> () }
      in case ds of () -> ...

   We were wrongly re-using that scrutinee as a case binder.
   And Trac #13043 showed that could ultimately lead to two
   top-level bindings with the same closure name.  Alas!

 - The desugarer had one other place (in DsUtils.mkCoreAppDs)
   that could generate bogus code

 This patch fixes all three bugs, and adds a regression test.
 }}}

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


More information about the ghc-tickets mailing list