Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
GHC
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Package Registry
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex D
GHC
Commits
76d0cbcb
Commit
76d0cbcb
authored
Jul 22, 2013
by
gmainlan@microsoft.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add final remaining bits to fix #7978.
parent
e7de764a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
30 deletions
+1
-30
compiler/codeGen/StgCmmBind.hs
compiler/codeGen/StgCmmBind.hs
+1
-30
No files found.
compiler/codeGen/StgCmmBind.hs
View file @
76d0cbcb
...
...
@@ -207,40 +207,11 @@ cgRhs id (StgRhsCon cc con args)
=
withNewTickyCounterThunk
False
(
idName
id
)
$
-- False for "not static"
buildDynCon
id
True
cc
con
args
{- See Note [GC recovery] in compiler/codeGen/StgCmmClosure.hs -}
cgRhs
name
(
StgRhsClosure
cc
bi
fvs
upd_flag
_srt
args
body
)
|
null
fvs
-- See Note [Nested constant closures]
=
do
{
(
info
,
fcode
)
<-
cgTopRhsClosure
Recursive
name
dontCareCCS
bi
upd_flag
args
body
;
return
(
info
,
fcode
>>
return
mkNop
)
}
|
otherwise
=
do
dflags
<-
getDynFlags
mkRhsClosure
dflags
name
cc
bi
(
nonVoidIds
fvs
)
upd_flag
args
body
{- Note [Nested constant closures]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If we have
f x = let funny = not True
in ...
then 'funny' is a nested closure (compiled with cgRhs) that has no free vars.
This does not happen often, because let-floating takes them all to top
level; but it CAN happen. (Reason: let-floating may make a function f smaller
so it can be inlined, so now (f True) may generate a local no-fv closure.
This actually happened during bootsrapping GHC itself, with f=mkRdrFunBind
in TcGenDeriv.)
If we have one of these things, AND they allocate, the heap check will
refer to the static funny_closure; but there isn't one! (Why does the
heap check refer to the static closure? Becuase nodeMustPointToIt is
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.
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
------------------------------------------------------------------------
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment