Fix a nasty float-in bug
authorsimonpj@microsoft.com <unknown>
Fri, 22 Aug 2008 13:34:27 +0000 (13:34 +0000)
committersimonpj@microsoft.com <unknown>
Fri, 22 Aug 2008 13:34:27 +0000 (13:34 +0000)
commit081d294c2a4a9e886e96ab50cf43718b54696646
tree2d882175af98cab4ce00baf9d4e2b02ca9798f13
parent10f18550c3684368b9d8e5b7adcccc14994cf170
Fix a nasty float-in bug

This is a long-standing bug in FloatIn, which I somehow managed to
tickle (it's actually surprisingly hard to provoke which is why
it has not shown up before).

The problem was that we had a specialisation like this:

  let
f_spec = ...
  in let
{-# RULE f Int = f_spec #-}
f = ...
  in
<body>

The 'f_spec' binding was being floated inside the binding for 'f',
which makes the RULE invalid becuase 'f_spec' isn't in scope.

We just need to add the free variables of the RULE in the right
places...
compiler/simplCore/FloatIn.lhs