|
From: | Philippe Mathieu-Daudé |
Subject: | Re: [PATCH] tcg: Reset free_temps before tcg_optimize |
Date: | Sun, 8 Dec 2024 19:01:17 +0100 |
User-agent: | Mozilla Thunderbird |
On 7/12/24 22:47, Richard Henderson wrote:
When allocating new temps during tcg_optmize, do not re-use any EBB temps that were used within the TB. We do not have any idea what span of the TB in which the temp was live. Cc: qemu-stable@nongnu.org Fixes: fb04ab7ddd8 ("tcg/optimize: Lower TCG_COND_TST{EQ,NE} if unsupported")
Hmm, the problem is due to arg_new_temp()?
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2711 Reported-by: wannacu <wannacu2049@gmail.com> Signed-off-by: Richard Henderson <richard.henderson@linaro.org> --- Unless there's some other reason to spin an -rc4, this can wait to be the first patch for 10.0.1. r~ --- tcg/tcg.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tcg/tcg.c b/tcg/tcg.c index 0babae1b88..eece825e2e 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -6120,6 +6120,9 @@ int tcg_gen_code(TCGContext *s, TranslationBlock *tb, uint64_t pc_start) } #endif+ /* Do not reuse any EBB that may be allocated within the TB. */+ memset(s->free_temps, 0, sizeof(s->free_temps));
Maybe add as tcg_temp_[ebb]_[reset|flush]() helper so we can reuse, like in tcg_func_start() and plugin_gen_inject()?
tcg_optimize(s);reachable_code_pass(s);
[Prev in Thread] | Current Thread | [Next in Thread] |