SpecConstr doesn't specialise
Compile this with -O2 -fno-spec-constr-count
:
foo :: Int -> Int -> Bool
foo n x = loop 0 False (Just x)
where
loop i b x | i > n = b
loop i False x = loop (i+1) True x
loop i True (Just x) = loop (i+1) False Nothing
loop i True Nothing = loop (i+1) True (Just x)
!SpecConstr produces a loop of type Maybe Int -> Int# -> Bool
, i.e., it doesn't specialise for the Maybe
argument for some reason.
Trac metadata
Trac field | Value |
---|---|
Version | 7.1 |
Type | Bug |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | Compiler |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | |
Operating system | |
Architecture |