From ae30e86661b0f48562cd95918d37cbeec5d02262 Mon Sep 17 00:00:00 2001 From: Richard Henderson Date: Sat, 23 Jan 2021 12:11:17 -1000 Subject: tcg: Restart code generation when we run out of temps MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Some large translation blocks can generate so many unique constants that we run out of temps to hold them. In this case, longjmp back to the start of code generation and restart with a smaller translation block. Buglink: https://bugs.launchpad.net/bugs/1912065 Tested-by: BALATON Zoltan Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- include/tcg/tcg.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include') diff --git a/include/tcg/tcg.h b/include/tcg/tcg.h index c5a9d65..0f0695e 100644 --- a/include/tcg/tcg.h +++ b/include/tcg/tcg.h @@ -680,6 +680,9 @@ struct TCGContext { uint16_t gen_insn_end_off[TCG_MAX_INSNS]; target_ulong gen_insn_data[TCG_MAX_INSNS][TARGET_INSN_START_WORDS]; + + /* Exit to translator on overflow. */ + sigjmp_buf jmp_trans; }; static inline bool temp_readonly(TCGTemp *ts) -- cgit v1.1