Skip to content

Commit

Permalink
Add a work-around for #7978.
Browse files Browse the repository at this point in the history
This patch fixes profiling at the cost of losing cost centre accounting in a
very small number of cases. I am working on a better fix.
  • Loading branch information
Geoffrey Mainland committed Jun 22, 2013
1 parent 3660ef9 commit bdc3775
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions compiler/codeGen/StgCmmBind.hs
Expand Up @@ -209,7 +209,7 @@ cgRhs id (StgRhsCon cc con args)

cgRhs name (StgRhsClosure cc bi fvs upd_flag _srt args body)
| null fvs -- See Note [Nested constant closures]
= do { (info, fcode) <- cgTopRhsClosure Recursive name cc bi upd_flag args body
= do { (info, fcode) <- cgTopRhsClosure Recursive name dontCareCCS bi upd_flag args body
; return (info, fcode >> return mkNop) }
| otherwise
= do dflags <- getDynFlags
Expand All @@ -234,7 +234,12 @@ False, which is fair enough.)
Simple solution: compile the RHS as if it was top level. Then
everything works. A minor benefit is eliminating the allocation code
too. -}
too.
GBM: when we compile the RHS as if it were top level, the cost centre stack in
the StgRhsClosure is no longer valid. For now we replace the cost centre stack
with dontCareCCS.
-}

------------------------------------------------------------------------
-- Non-constructor right hand sides
Expand Down

0 comments on commit bdc3775

Please sign in to comment.