[commit: ghc] master: Add RubbishLit for absent bindings of UnliftedRep (448b77b)
git at git.haskell.org
git at git.haskell.org
Sun Oct 14 20:05:25 UTC 2018
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/448b77b93b369745e9bfbc8b46a5b87bb73dd379/ghc
>---------------------------------------------------------------
commit 448b77b93b369745e9bfbc8b46a5b87bb73dd379
Author: Sebastian Graf <sebastian.graf at kit.edu>
Date: Sun Oct 14 20:32:40 2018 +0200
Add RubbishLit for absent bindings of UnliftedRep
Summary:
Trac #9279 reminded us that the worker wrapper transformation copes
really badly with absent unlifted boxed bindings.
As `Note [Absent errors]` in WwLib.hs points out, we can't just use
`absentError` for unlifted bindings because there is no bottom to hide
the error in.
So instead, we synthesise a new `RubbishLit` of type
`forall (a :: TYPE 'UnliftedRep). a`, which code-gen may subsitute for
any boxed value. We choose `()`, so that there is a good chance that
the program crashes instead instead of leading to corrupt data, should
absence analysis have been too optimistic (#11126).
Reviewers: simonpj, hvr, goldfire, bgamari, simonmar
Reviewed By: simonpj
Subscribers: osa1, rwbarton, carter
GHC Trac Issues: #15627, #9279, #4306, #11126
Differential Revision: https://phabricator.haskell.org/D5153
>---------------------------------------------------------------
448b77b93b369745e9bfbc8b46a5b87bb73dd379
compiler/basicTypes/Literal.hs | 87 +++++-
compiler/codeGen/StgCmmUtils.hs | 1 +
compiler/coreSyn/CoreUtils.hs | 11 +-
compiler/ghci/ByteCodeAsm.hs | 4 +
compiler/ghci/ByteCodeGen.hs | 1 +
compiler/prelude/TysPrim.hs | 13 +
compiler/prelude/TysWiredIn.hs | 2 +-
compiler/stgSyn/CoreToStg.hs | 10 +-
compiler/stranal/WwLib.hs | 36 ++-
testsuite/tests/stranal/should_compile/T15627.hs | 19 ++
.../tests/stranal/should_compile/T15627.stderr | 338 +++++++++++++++++++++
testsuite/tests/stranal/should_compile/all.T | 6 +
12 files changed, 508 insertions(+), 20 deletions(-)
Diff suppressed because of size. To see it, use:
git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 448b77b93b369745e9bfbc8b46a5b87bb73dd379
More information about the ghc-commits
mailing list