[GHC] #9718: Avoid TidyPgm predicting what CorePrep will do

GHC ghc-devs at haskell.org
Mon Dec 10 11:22:20 UTC 2018


#9718: Avoid TidyPgm predicting what CorePrep will do
-------------------------------------+-------------------------------------
        Reporter:  simonpj           |                Owner:  (none)
            Type:  task              |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  7.8.3
      Resolution:                    |             Keywords:  CodeGen, CAFs
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by osa1):

 Aha, found the problem. We run the code generator twice with `-dynamic-
 too`, but
 normally we write the interface files only once (`hscWriteIface` generates
 two
 interfaces, a `.hi` and a `.dyn-hi`). Now if I call `hscWriteIface` again
 after
 STG generation I end up calling `hscWriteIface` two more times, one for
 the
 normal compilation and one for `-dynamic-too`. The first call correctly
 updates
 both interface files, then before the second call we update the `DynFlags`
 to
 add `WayDyn` way and remove `Opt_BuildDynamicToo` (in
 `dynamicTooMkDynamicDynFlags`), so the second call to `hscWriteIface`
 updates
 the normal iface file (not the dyn iface), but updates it with `WayDyn`.

 Correct behavior: in the first codegen we should only update the normal
 iface
 file, in the second only the dyn iface file.

 Not sure how to implement this yet.

 (I'll look at comment:39 later)

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


More information about the ghc-tickets mailing list