Typechecker tests failures

Hello, I was working on #9605, and found a number of failed tests: Unexpected failures: should_compile T7891 [exit code non-0] (hpc,optasm,optllvm) should_compile tc124 [exit code non-0] (hpc,optasm,optllvm) should_run T7861 [bad exit code] (normal,hpc,optasm,ghci,threaded1,threaded2,dyn,optllvm) They seem to be unrelated to my work, and they are skipped when "fast" is enabled. T7891 and tc124 fail with Core Lint errors. Looks like Phabricator uses "fast" way to validate revisions, so the failures were not noticed. Thanks, Yuras

Simon, I tracked T7891 and tc124 failure down to simplifier, namely `simplExprF1` for `Case`. Core lint catches the bug (requires -O1 at least), but without -dcore-lint compiler hangs in busy loop. I made it work with simple patch:
diff --git a/compiler/simplCore/Simplify.hs b/compiler/simplCore/Simplify.hs index 7611f56..d396b60 100644 --- a/compiler/simplCore/Simplify.hs +++ b/compiler/simplCore/Simplify.hs @@ -950,8 +950,10 @@ simplExprF1 env expr@(Lam {}) cont zap b | isTyVar b = b | otherwise = zapLamIdInfo b
-simplExprF1 env (Case scrut bndr _ alts) cont - = simplExprF env scrut (Select NoDup bndr alts env cont) +simplExprF1 env (Case scrut bndr alts_ty alts) cont + = do { expr <- simplExprC env scrut (Select NoDup bndr alts env + (mkBoringStop alts_ty)) + ; rebuild env expr cont }
simplExprF1 env (Let (Rec pairs) body) cont = do { env' <- simplRecBndrs env (map fst pairs)
(I have no idea what most of this code does, but I learned a lot while investigating this issue :) ) The relevant commit is:
commit a0b2897ee406e24a05c41768a0fc2395442dfa06 Author: Simon Peyton Jones
Date: Tue May 27 09:09:28 2014 +0100 Simple refactor of the case-of-case transform
More modular, less code. No change in behaviour.
The T7861 failed because additional lambda abstraction in Core. Not sure whether it is important. Thanks, Yuras On Sat, 2014-12-06 at 19:04 +0300, Yuras Shumovich wrote:
Hello,
I was working on #9605, and found a number of failed tests:
Unexpected failures: should_compile T7891 [exit code non-0] (hpc,optasm,optllvm) should_compile tc124 [exit code non-0] (hpc,optasm,optllvm) should_run T7861 [bad exit code] (normal,hpc,optasm,ghci,threaded1,threaded2,dyn,optllvm)
They seem to be unrelated to my work, and they are skipped when "fast" is enabled.
T7891 and tc124 fail with Core Lint errors.
Looks like Phabricator uses "fast" way to validate revisions, so the failures were not noticed.
Thanks, Yuras

Thanks. This was being tracked in Trac #9567, and I have finally gotten around to fixing it. Your proposed change is small, but it simply avoids the crash without fixing the cause. The cause was that contInputType was simply *wrong*.
https://ghc.haskell.org/trac/ghc/ticket/9567
Fixed now!
Simon
| -----Original Message-----
| From: Yuras Shumovich [mailto:shumovichy@gmail.com]
| Sent: 08 December 2014 05:48
| To: Simon Peyton Jones
| Cc: ghc-devs@haskell.org Devs
| Subject: Re: Typechecker tests failures
|
|
| Simon,
|
| I tracked T7891 and tc124 failure down to simplifier, namely
| `simplExprF1` for `Case`. Core lint catches the bug (requires -O1 at
| least), but without -dcore-lint compiler hangs in busy loop. I made it
| work with simple patch:
|
| > diff --git a/compiler/simplCore/Simplify.hs
| > b/compiler/simplCore/Simplify.hs index 7611f56..d396b60 100644
| > --- a/compiler/simplCore/Simplify.hs
| > +++ b/compiler/simplCore/Simplify.hs
| > @@ -950,8 +950,10 @@ simplExprF1 env expr@(Lam {}) cont
| > zap b | isTyVar b = b
| > | otherwise = zapLamIdInfo b
| >
| > -simplExprF1 env (Case scrut bndr _ alts) cont
| > - = simplExprF env scrut (Select NoDup bndr alts env cont)
| > +simplExprF1 env (Case scrut bndr alts_ty alts) cont
| > + = do { expr <- simplExprC env scrut (Select NoDup bndr alts env
| > + (mkBoringStop alts_ty))
| > + ; rebuild env expr cont }
| >
| > simplExprF1 env (Let (Rec pairs) body) cont
| > = do { env' <- simplRecBndrs env (map fst pairs)
|
| (I have no idea what most of this code does, but I learned a lot while
| investigating this issue :) )
|
| The relevant commit is:
|
| > commit a0b2897ee406e24a05c41768a0fc2395442dfa06
| > Author: Simon Peyton Jones
participants (2)
-
Simon Peyton Jones
-
Yuras Shumovich