[GHC] #13417: piResultTys1
GHC
ghc-devs at haskell.org
Tue Mar 14 13:48:37 UTC 2017
#13417: piResultTys1
-------------------------------------+-------------------------------------
Reporter: ralf | Owner: (none)
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 8.0.2
Resolution: | Keywords:
Operating System: Linux | Architecture: x86_64
Type of failure: Compile-time | (amd64)
crash or panic | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s):
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by simonpj):
Here's a simpler test case
{{{
data T a = E7
cons7 :: T a -> T b
cons7 E7 = E7
}}}
Amazingly, this crashes 8.0.2, because of this egregious bug in
`SimplUtils.mkCase1`:
{{{
check_eq (Var v) (DataAlt con) [] = v == dataConWorkId con
-- Optimisation only
...
check_eq rhs (DataAlt con) args = cheapEqExpr' tickishFloatable
rhs $
mkConApp con (arg_tys ++
varsToCoreExprs
args)
}}}
The first of these equations ("optimisation only") is only equivalent to
the second if `arg_tys` is empty, which it isn't in this case.
This bug has been there since I introduced it in Nov 2011:
{{{
commit 02ac2974ce8e537372bff8d9e0a6efb461ed2c59
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date: Wed Nov 16 10:37:47 2011 +0000
Fix CaseIdentity optimisaion
In fixing one bug I'd introduced another;
case x of { T -> T; F -> F }
wasn't getting optmised! Trivial to fix.
}}}
It's just rather hard to trigger. Unrelated changes in HEAD mean that it
no longer shows up. But I'll fix it anyway!
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13417#comment:8>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list