[commit: ghc] master: Fix an long-standing bug in OccurAnal (6ec2304)

git at git.haskell.org git at git.haskell.org
Mon Nov 28 08:36:55 UTC 2016


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/6ec2304f46c9a5423943c5bf29bd8a8c062b6560/ghc

>---------------------------------------------------------------

commit 6ec2304f46c9a5423943c5bf29bd8a8c062b6560
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date:   Sun Nov 27 23:35:12 2016 +0000

    Fix an long-standing bug in OccurAnal
    
    This bug was beautifully characterised in Trac #12776,
    which showed a small program for which the inliner went
    into an infinite loop.  Eeek.
    
    It turned out to be a genuine and long-standing bug in
    the occurrence analyer, specifically in the bit that
    identifies loop breakers.  In this line
    
      pairs | isEmptyVarSet weak_fvs
            = reOrderNodes   0 bndr_set weak_fvs tagged_nodes []
            | otherwise
            = loopBreakNodes 0 bndr_set weak_fvs loop_breaker_edges []
    
    the 'tagged_nodes' should be 'loop_breaker_edges'.
    That's it!
    
    The diff looks a lot bigger because I did some work on
    comments and variable naming, but that's all it is.  We
    were using the wrong set of dependencies!
    
    I'm astonished that this bug has not caused more trouble.
    It dates back to at least 2011 and maybe further.


>---------------------------------------------------------------

6ec2304f46c9a5423943c5bf29bd8a8c062b6560
 compiler/simplCore/OccurAnal.hs | 228 ++++++++++++++++++++++++----------------
 1 file changed, 139 insertions(+), 89 deletions(-)

Diff suppressed because of size. To see it, use:

    git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 6ec2304f46c9a5423943c5bf29bd8a8c062b6560


More information about the ghc-commits mailing list