
#11444: 8.0 rc1 panics in applyTypeToArgs -------------------------------------+------------------------------------- Reporter: osa1 | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1-rc1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by simonpj): Omer, any thoughts about comment:5? On comment:2 * Assume for now that `reallyUnsafePtrEquality# @ a_a1Ts x_X1wq y_X1ws` is ''not'' ok-for-speculation. Then the transformation you show above should not happen. Look at this code in `Simplify`: {{{ -- 2b. Turn the case into a let, if -- a) it binds only the case-binder -- b) unlifted case: the scrutinee is ok-for-speculation -- lifted case: the scrutinee is in HNF (or will later be demanded) | all_dead_bndrs , if is_unlifted then exprOkForSpeculation scrut -- See Note [Case elimination: unlifted case] else exprIsHNF scrut -- See Note [Case elimination: lifted case] || scrut_is_demanded_var scrut = do { tick (CaseElim case_bndr) ; env' <- simplNonRecX env case_bndr scrut ; simplExprF env' rhs cont } }}} We are in the unlifted case, and `exprOkForSpeculation` is false, so this case should not fire. But I think it is firing. Why? Can you check that this really is happening (e.g. there is a `CaseElim` on this case binder)? And figure out why? Can you make a small test case so I can see? Separately, it's true that `exprOkForSpeculation` is being conservative; see this comment in `CoreUtils.app_ok` {{{ | otherwise -> primop_ok op -- A bit conservative: we don't really need && all (expr_ok primop_ok) args -- to care about lazy arguments, but this is easy }}} Let me know if you need more help. Simon -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11444#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler