Fix an old but subtle bug in the Simplifier
authorsimonpj@microsoft.com <unknown>
Mon, 5 Nov 2007 16:13:14 +0000 (16:13 +0000)
committersimonpj@microsoft.com <unknown>
Mon, 5 Nov 2007 16:13:14 +0000 (16:13 +0000)
commit58e45ee86bbda3f24a4caf41c0aea7a6b787367e
tree8dac64dd7585270639ebfa044e0381e77d1e32b4
parent565ccc310f52cca11b2eb610e96e45abfb8f3a18
Fix an old but subtle bug in the Simplifier

I got a Core Lint failure when compiling System.Win32.Info in the
Win32 package.  It was very delicate: adding or removing a function
definition elsewhere in the module (unrelated to the error) made the
error go away.

Happily, I found it.  In SimplUtils.prepareDefault I was comparing an
InId with an OutId.  We were getting a spurious hit, and hence doing
a bogus CaseMerge.

This bug has been lurking ever since I re-factored the way that case
expressions were simplified, about 6 months ago!
compiler/simplCore/SimplEnv.lhs
compiler/simplCore/SimplUtils.lhs
compiler/simplCore/Simplify.lhs