diff options
| author | Richard Henderson <richard.henderson@linaro.org> | 2024-12-07 18:14:45 +0000 |
|---|---|---|
| committer | Richard Henderson <richard.henderson@linaro.org> | 2024-12-12 14:28:38 -0600 |
| commit | 04e006ab36a8565b92d4e21dd346367fbade7d74 (patch) | |
| tree | 8364771d26de817936e3f96022fe60a59b9a870e /accel/tcg/plugin-gen.c | |
| parent | a5ba0a7e4e150d1350a041f0d0ef9ca6c8d7c307 (diff) | |
| download | focaccia-qemu-04e006ab36a8565b92d4e21dd346367fbade7d74.tar.gz focaccia-qemu-04e006ab36a8565b92d4e21dd346367fbade7d74.zip | |
tcg: Reset free_temps before tcg_optimize
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.
Introduce tcg_temp_ebb_reset_freed and use before tcg_optimize,
as well as replacing the equivalent in plugin_gen_inject and
tcg_func_start.
Cc: qemu-stable@nongnu.org
Fixes: fb04ab7ddd8 ("tcg/optimize: Lower TCG_COND_TST{EQ,NE} if unsupported")
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2711
Reported-by: wannacu <wannacu2049@gmail.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Diffstat (limited to 'accel/tcg/plugin-gen.c')
| -rw-r--r-- | accel/tcg/plugin-gen.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/accel/tcg/plugin-gen.c b/accel/tcg/plugin-gen.c index 0f47bfbb48..1ef075552c 100644 --- a/accel/tcg/plugin-gen.c +++ b/accel/tcg/plugin-gen.c @@ -275,7 +275,7 @@ static void plugin_gen_inject(struct qemu_plugin_tb *plugin_tb) * that might be live within the existing opcode stream. * The simplest solution is to release them all and create new. */ - memset(tcg_ctx->free_temps, 0, sizeof(tcg_ctx->free_temps)); + tcg_temp_ebb_reset_freed(tcg_ctx); QTAILQ_FOREACH_SAFE(op, &tcg_ctx->ops, link, next) { switch (op->opc) { |