Skip to content

Fix terrible occurrence-analysis bug

Simon Peyton Jones requested to merge wip/T19360 into master

Ticket #19360 (closed) showed up a terrible bug in the occurrence analyser, in a situation like this

   Rec { f = g
       ; g = ..f...
         {-# RULE g .. = ...f... #-}  }

Then f was postInlineUnconditionally, but not in the RULE (which is simplified first), so we had a RULE mentioning a variable that was not in scope.

This led me to review (again) the subtle loop-breaker stuff. The actual changes are few, and are simplifications. I did a lot of comment re-organising though.

Edited by Simon Peyton Jones

Merge request reports