cvs commit: fptools/ghc/tests/cpranal Makefile fptools/ghc/tests/cpranal/should_compile Cpr001.hs Cpr001_imp.hs Makefile

Simon Marlow simonmar@microsoft.com
Wed, 28 Mar 2001 10:11:47 +0100


> kglynn      2001/03/27 21:07:34 PST
>=20
>   Added files:
>     ghc/tests/cpranal    Makefile=20
>     ghc/tests/cpranal/should_compile Cpr001.hs Cpr001_imp.hs=20
>                                      Makefile=20
>   Log:
>   Cpr needs the correct arity for an imported function.  In some cases
>   the arity reported in the interface can be too small.
>  =20
>   In this test case the function is returning a newtype,  and=20
> the newtype
>   is hiding a function.  The arity in the interface file says=20
> 0.  It is
>   triggered by compiling the cpr001.hs test files with=20
> profiling on. The code
>   comes from a bug report.
>  =20
>   I should look for a better case,  because the profiling=20
> flaw which reveals
>   this problem will hopefully go away some time.

I've fixed a problem in the simplifier which meant that the _scc_ wasn't
getting pushed inside the lambda as it should.  But that's not the real
problem: I think the CPR analysis is treating the _scc_ annotation as if
it was invisible: it shouldn't.  A function whose definition is `_scc_
"foo" (\x -> e)' does indeed have arity zero.

Cheers,
	Simon