Fix Trac #3403: interaction of CPR and pattern-match failure
authorsimonpj@microsoft.com <unknown>
Tue, 8 Sep 2009 13:14:00 +0000 (13:14 +0000)
committersimonpj@microsoft.com <unknown>
Tue, 8 Sep 2009 13:14:00 +0000 (13:14 +0000)
commit8a25c54e2df36b3fb40436e5b887dddc3c64ab54
treea1b9385e06400e218667b09ddc1c93568446c7c4
parenta0d2e0fb1a6b717ad5ecf7bfaa208863af4378ab
Fix Trac #3403: interaction of CPR and pattern-match failure

A fine bug report (#3403) demonstrated that we were losing the tail
call property when a complicated pattern match was involved.  After
a bit of investigation I discovered that the culprit was the failure
join-point introduced by the pattern matcher.  It was a zero-argument
thunk, which is not very CPR-friendly, and that interacted badly with
CPR worker/wrapper.

It's easy to fix, the same way that we fix other join points, by supplying
a dummy argument (that is not really passed at runtime.
compiler/deSugar/DsUtils.lhs