#13429: Optimizer produces Core with an infinite <<loop>> -------------------------------------+------------------------------------- Reporter: lehins | Owner: simonpj Type: bug | Status: new Priority: highest | Milestone: 8.2.1 Component: Compiler | Version: 8.0.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: Runtime crash | Test Case: Blocked By: | Blocking: Related Tickets: #13750 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by Simon Peyton Jones <simonpj@…>): In [changeset:"2b74bd9d8b4c6b20f3e8d9ada12e7db645cc3c19/ghc" 2b74bd9d/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="2b74bd9d8b4c6b20f3e8d9ada12e7db645cc3c19" Stop the specialiser generating loopy code This patch fixes a bad bug in the specialiser, which showed up as Trac #13429. When specialising an imported DFun, the specialiser could generate a recusive loop where none existed in the original program. It's all rather tricky, and I've documented it at some length in Note [Avoiding loops] We'd encoutered exactly this before (Trac #3591) but I had failed to realise that the very same thing could happen for /imported/ DFuns. I did quite a bit of refactoring. The compiler seems to get a tiny bit faster on deriving/perf/T10858 but almost all the gain had occurred before now; this patch just pushed it over the line. }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13429#comment:25> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler