diff options
author | xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e> | 2013-05-27 13:22:32 +0000 |
---|---|---|
committer | xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e> | 2013-05-27 13:22:32 +0000 |
commit | 85c3c92d4ea73393ee67da8f3b811d221b4e06f5 (patch) | |
tree | 9484e5cff6f4fc1f36cc16351fd1d3808f6b167c /backend/IRC.ml | |
parent | ff63a02431cb601eee8987730891ed036517e5a9 (diff) | |
download | compcert-85c3c92d4ea73393ee67da8f3b811d221b4e06f5.tar.gz compcert-85c3c92d4ea73393ee67da8f3b811d221b4e06f5.zip |
Hunting stack overflows again:
PrintLTL: List.map -> List.rev_map
IRC: @ -> List.rev_append + don't maintain "extra" lists on precolored nodes.
git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@2262 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e
Diffstat (limited to 'backend/IRC.ml')
-rw-r--r-- | backend/IRC.ml | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/backend/IRC.ml b/backend/IRC.ml index 79d66b9c..64de4e47 100644 --- a/backend/IRC.ml +++ b/backend/IRC.ml @@ -640,13 +640,15 @@ let combine g u v = else DLinkNode.move v g.spillWorklist g.coalescedNodes; v.alias <- Some u; (* Precolored nodes often have big movelists, and if one of [u] and [v] - is precolored, it is []u. So, append [v.movelist] to [u.movelist] + is precolored, it is [u]. So, append [v.movelist] to [u.movelist] instead of the other way around. *) u.movelist <- List.rev_append v.movelist u.movelist; u.spillcost <- u.spillcost +. v.spillcost; iterAdjacent (combineEdge g u) v; (*r original code using [decrementDegree] is buggy *) - u.extra_adj <- u.extra_adj @ v.extra_adj; - u.extra_pref <- u.extra_pref @ v.extra_pref; + if u.nstate <> Colored then begin + u.extra_adj <- List.rev_append v.extra_adj u.extra_adj; + u.extra_pref <- List.rev_append v.extra_pref u.extra_pref + end; enableMoves g v; (*r added as per Appel's book erratum *) if u.degree >= g.num_available_registers.(u.regclass) && u.nstate = FreezeWorklist |