OccurAnal.hs: Add an assert for an invariant
authorÖmer Sinan Ağacan <omeragacan@gmail.com>
Sun, 19 Mar 2017 05:28:37 +0000 (08:28 +0300)
committerÖmer Sinan Ağacan <omeragacan@gmail.com>
Sun, 19 Mar 2017 05:28:54 +0000 (08:28 +0300)
Reviewers: austin, bgamari, dfeuer

Reviewed By: bgamari, dfeuer

Subscribers: rwbarton, thomie

Differential Revision: https://phabricator.haskell.org/D3360

compiler/simplCore/OccurAnal.hs

index baa5c24..6093f42 100644 (file)
@@ -2606,7 +2606,8 @@ tagNonRecBinder lvl usage binder
  = let
      occ     = lookupDetails usage binder
      will_be_join = decideJoinPointHood lvl usage [binder]
-     occ'    | will_be_join = occ -- must already be marked AlwaysTailCalled
+     occ'    | will_be_join = -- must already be marked AlwaysTailCalled
+                              ASSERT(isAlwaysTailCalled occ) occ
              | otherwise    = markNonTailCalled occ
      binder' = setBinderOcc occ' binder
      usage'  = usage `delDetails` binder