
#11731: Demand analysis: Thunk wrongly determined single-entry
-------------------------------------+-------------------------------------
Reporter: nomeata | Owner:
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 8.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 nomeata):
{{{
Entries Alloc Alloc'd #Alloc Single Multiple Non-
void Arguments STG Name
4096 0 65536 2048 0 2048 0
sat_s2vw{v} (main@main:GamtebMain) (thk,se) in r2uq
}}}
The relevant `-ddump-prep` code is this:
{{{
let {
sat_s2vw [Occ=Once,
Dmd=,
Unf=OtherCon []] =
\r srt:SRT:[r4K :-> Utils.$wgenRand, r5x :-> Compton.$wcompton,
r5O :-> Pair.$wpair, r3Df :-> TransPort.$wtransPort,
r3Dr :-> lvl11_r3Dr] [ww_s3Dy
ww1_s3Dz
ww2_s3DA
ww3_s3DB
ww4_s3DC
ww5_s3DD
ww6_s3DE
ww7_s3DF
ww8_s3DG
ww9_s3DH
ww10_s3DI
ww11_s3DJ
ww12_s3DK
ww13_s3DL]
case Utils.$wgenRand ww10_s3DI of _ [Occ=Dead] {
(#,#) ww15_s3DN [Occ=Once!] ww16_s3DO ->
}}}
Note how the strictness signature say that the `Random` argument is used
at most once (`1*U(U)`). The call to `$wgenRand` is indeed the only use of
`ww10_s3DI`. So here is the code of `$wgenRand`:
{{{
Utils.$wgenRand [InlPrag=[0]]
:: GamtebType.Random -> (# GamtebType.Random, GamtebType.Random #)
[GblId, Arity=1, Str=DmdType