
#11770: Demand analysis: Wrong one-shot annotation due to fixed-point iteration -------------------------------------+------------------------------------- Reporter: nomeata | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.1 Resolution: | Keywords: 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 simonpj): Yikes! That's terrible! As well as that outright bug, there's a strange duplication: * the demand analyser goes to some effort to annotate one-shot info (e.g. `annLamWithShotness`) * but so does the occurrence analyser (see the `occ_one_shots` field of `OccEnv`) Let's do it in the occurrence analyser, as now. So try this: * Get rid of all one-shot setting in the demand analyser, letting the occurrence analyser do the work. The demand analyser would then annotate only demand info. * BUT in `OccAnal.oneShotGroup` I'm suspicious of that `updOneShotInfo` which keeps one-shot info if it was there before. I don't think it's an actual bug, but I'd be much more comfortable with using `setIdOneShotInfo` instead. That's an orthogonal change. Would you like to try those two changes (ideally independently) and see what effect it has? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11770#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler