From 3cf6a85eb32e173b533de47bcd530364ceb20dc5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Magnus=20L=C3=A5ng?= Date: Thu, 23 Mar 2017 22:03:03 +0100 Subject: HiPE: Fix off-by-one in register allocators hipe_regalloc_loop considers SpillLimit to be an inclusive lower bound, the allocators considered it to be an exclusive lower bound. The allocators are changed to also consider it an inclusive lower bound. This caused the register allocators to occasionally spill the first "unspillable" temporary. This caused a failure in a newly added assertion when hipe-compiling dets_v9 on x86. --- lib/hipe/regalloc/hipe_coalescing_regalloc.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/hipe/regalloc/hipe_coalescing_regalloc.erl') diff --git a/lib/hipe/regalloc/hipe_coalescing_regalloc.erl b/lib/hipe/regalloc/hipe_coalescing_regalloc.erl index e8ccbec9f1..b8f0a1974c 100644 --- a/lib/hipe/regalloc/hipe_coalescing_regalloc.erl +++ b/lib/hipe/regalloc/hipe_coalescing_regalloc.erl @@ -914,7 +914,7 @@ findCheapest([Node|Nodes], IG, Cost, Cheapest, SpillLimit) -> %% limit are extremely expensive. getCost(Node, IG, SpillLimit) -> - case Node > SpillLimit of + case Node >= SpillLimit of true -> inf; false -> hipe_ig:node_spill_cost(Node, IG) end. -- cgit v1.2.3