Fix combineIdenticalAlts
authorSimon Peyton Jones <simonpj@microsoft.com>
Wed, 20 Jan 2016 08:07:43 +0000 (08:07 +0000)
committerSimon Peyton Jones <simonpj@microsoft.com>
Wed, 20 Jan 2016 08:10:57 +0000 (08:10 +0000)
commit514bac264cb60db26ff9da10c6b79c3f5bd6e96d
tree64e1ea4d012933c744c0b4d88af68b637435ab53
parent975bdacb2c72b2ffd4eb8108896f9f984c5d4fcf
Fix combineIdenticalAlts

This long-standing bug in CoreUtils.combineIdenticalAlts
was shown up by Trac #11172. The effect was that it returned
a correct set of alternatives, but a bogus set of "impossible
default constructors".  That meant that we subsequently
removed all the alternatives from a case, and hence ended
up with a bogusly empty case that should not have been empty.

See Note [Care with impossible-constructors when
combining alternatives] in CoreUtils.
compiler/coreSyn/CoreUtils.hs
testsuite/tests/simplCore/should_run/T11172.hs [new file with mode: 0644]
testsuite/tests/simplCore/should_run/T11172.stdout [new file with mode: 0644]
testsuite/tests/simplCore/should_run/all.T