[GHC] #13977: ExnStr doesn't propagate "outwards"
GHC
ghc-devs at haskell.org
Sat Jul 15 00:18:19 UTC 2017
#13977: ExnStr doesn't propagate "outwards"
-------------------------------------+-------------------------------------
Reporter: bgamari | Owner: (none)
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 8.0.1
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 bgamari):
I think I might see why the demand analyser drops the `x`. Consider
`postProcessDmdEnv`,
{{{#!hs
postProcessDmdEnv :: DmdShell -> DmdEnv -> DmdEnv
postProcessDmdEnv ds@(JD { sd = ss, ud = us }) env
| Abs <- us = emptyDmdEnv
| Str _ _ <- ss
, Use One _ <- us = env -- Shell is a no-op
| otherwise = mapVarEnv (postProcessDmd ds) env
}}}
When we get here while demand-analysing the `catchRetry# @Char a`
application in `hello` we will have the "shell" equal to `JD {sd = Str
ExnStr (), ud = Use One ()}` (as computed as `defer_and_use` by
`dmdAnalStar`). The environment we are post-processing is
`{aQq-><C(S),1*C1(U)>}`. Note that the shell has an `ExnStr` which gets
eaten by the `Str _ _ <- ss` case of `postProcessDmdEnv`, meaning we don't
transform the environment. I haven't yet done enough reading to know
whether this is correct but is seems suspicious.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13977#comment:1>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list