|
From: Ivo R. <ir...@so...> - 2017-10-01 05:13:06
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=33053442153eabff2170bf5c862c57c10bc69071 commit 33053442153eabff2170bf5c862c57c10bc69071 Author: Ivo Raisr <iv...@iv...> Date: Sun Oct 1 07:12:05 2017 +0200 Register allocator: fix merging of Unallocated/Spilled vreg. Spilled vreg has no associated rreg to free. Diff: --- VEX/priv/host_generic_reg_alloc3.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/VEX/priv/host_generic_reg_alloc3.c b/VEX/priv/host_generic_reg_alloc3.c index 899fefe..81cf5c5 100644 --- a/VEX/priv/host_generic_reg_alloc3.c +++ b/VEX/priv/host_generic_reg_alloc3.c @@ -569,7 +569,7 @@ static inline HReg find_vreg_to_spill( incoming instruction stream as possible. An ideal rreg candidate is a callee-save register because it won't be used for parameter passing around helper function calls. */ -static Bool find_free_rreg( +static inline Bool find_free_rreg( const RegAllocChunk* chunk, RegAllocState* state, Short ii_chunk_current, HRegClass target_hregclass, Bool reserve_phase, const RegAllocControl* con, UInt* r_idx_found) @@ -1541,8 +1541,7 @@ static void merge_vreg_states(RegAllocChunk* chunk, case Unallocated: /* Good. Nothing to do. */ break; - case Assigned: /* fall through */ - case Spilled: + case Assigned: /* Should be dead by now. */ vassert(v2_src_state->dead_before <= chunk->next->ii_total_start); @@ -1550,6 +1549,12 @@ static void merge_vreg_states(RegAllocChunk* chunk, FREE_VREG(v2_src_state); FREE_RREG(&state2->rregs[hregIndex(rreg2)]); break; + case Spilled: + /* Should be dead by now. */ + vassert(v2_src_state->dead_before <= chunk->next->ii_total_start); + + FREE_VREG(v2_src_state); + break; default: vassert(0); } |