[GHC] #15300: Unboxed Sums Crash
GHC
ghc-devs at haskell.org
Thu Jul 12 10:04:18 UTC 2018
#15300: Unboxed Sums Crash
-------------------------------------+-------------------------------------
Reporter: andrewthad | Owner: osa1
Type: bug | Status: new
Priority: highest | Milestone: 8.6.1
Component: Compiler | Version: 8.5
Resolution: | Keywords: UnboxedSums
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 osa1):
I hacked the Id printer to print dead binders with their types. It turns
out the dead-but-used binder is this:
{{{
wild2_scuI [Occ=Dead]
:: (# GHC.Maybe.Maybe GHC.Types.Any | Packed.Bytes.Parser.Bytes# #)
}}}
This kind of variables (dead case binders with unboxed sum/tuple types)
are not supposed to be used! We even have a comment about this in
`UnariseStg`:
{{{
unariseExpr rho (StgCase scrut bndr alt_ty alts)
...
-- general case
| otherwise
= do scrut' <- unariseExpr rho scrut
alts' <- unariseAlts rho alt_ty bndr alts
return (StgCase scrut' bndr alt_ty alts')
-- bndr may have a unboxed sum/tuple type but it
will be
-- dead after unarise (checked in StgLint)
}}}
and we actually check this in StgLint:
{{{
lintStgExpr (StgCase scrut bndr alts_type alts) = do
...
-- Case binders of unboxed tuple or unboxed sum type always
dead
-- after the unariser has run.
-- See Note [Post-unarisation invariants].
MultiValAlt _ -> not (lf_unarised lf)
...
}}}
I don't understand yet why this program passes StgLint.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15300#comment:15>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list