
#14152: Float exit paths out of recursive functions -------------------------------------+------------------------------------- Reporter: nomeata | Owner: (none) Type: task | Status: patch Priority: normal | Milestone: Component: Compiler | Version: 8.2.1 Resolution: | Keywords: JoinPoints Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #14137 #10918 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by simonpj): Joachim, I've just been looking at `Exitify.hs` in pursuit of #15005. It's not easy going. Could you add some careful Notes? For example, here are the things I stumbled over immediately: * In the top-level `exitifyProgram` I think we make no attempt to exitify top level recursive functions. That's fine, but say so. * Then in `go` of `exitifyProgram` I think we are looking at the RHS of a top-level function, and applying `goBind` to every binding within it. (NB: `goBind` calls `go` to deal with the RHS of the bindings; I'd be inlined do that in `go` so that `goBind` gets the post-exitify bindings.) * Mysteriously we do not exitify the RHS of a case alternative (`goAlts`). This exception seems highly mysterious, possibly a bug? * Then for recursive join-point bindings, we apply `exitify` to them (after having recursively processed the RHSs). * There is some magic in `go` in `exitify` to pick out the ones we want to exitify. Explaining these conditions in a note would be good -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14152#comment:33 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler