Commit d6fd2e37 authored by Joachim Breitner's avatar Joachim Breitner

DmdAnal: Testcase about splitFVs and dmdFix abortion

Any variable with useful information (strict or used-once) will not be
included in lazy_fv (according to splitFVs). If we now also remove them
from the strictness signatures, their uses are not recorded anywhere –
and then probably considered absent.
parent 8d92b88d
-- Needs to be a product type
data Stream = S Int Stream
-- a is wrongly recorded abstent if the non-lazy-fv from foo are thrown away.
bar :: Int -> Int -> Stream -> Int
bar a n s = foo n s
where
-- Non terminating local rec, strict in a
foo :: Int -> Stream -> Int
foo 0 (S n s) = a
foo i (S n s) = a `seq` n + foo (i-1) s
{-# NOINLINE bar #-}
baz :: Int -> Int -> Int
baz 0 not_absent = 0
baz 1 not_absent = baz 2 not_absent
baz x not_absent = bar not_absent 1000 arg
where
arg = S 1 arg
bamf x = baz x (error "This is good!")
{-# NOINLINE bamf #-}
main :: IO ()
main = bamf 10 `seq` return ()
T12368a: This is good!
CallStack (from HasCallStack):
error, called at T12368a.hs:22:17 in main:Main
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment