On 15/07/16 09:45, Stefan Weil wrote: > Hi, > > Am 11.05.2016 um 12:21 schrieb Sergey Fedorov: > [...] >> int cpu_exec(CPUState *cpu) >> @@ -516,8 +576,6 @@ int cpu_exec(CPUState *cpu) >> CPUArchState *env = &x86_cpu->env; >> #endif >> int ret; >> - TranslationBlock *tb, *last_tb; >> - int tb_exit = 0; > Here tb_exit was only once set to 0, ... > >> SyncClocks sc; >> >> /* replay_interrupt may need current_cpu */ >> @@ -544,6 +602,9 @@ int cpu_exec(CPUState *cpu) >> init_delay_params(&sc, cpu); >> >> for(;;) { >> + TranslationBlock *tb, *last_tb; >> + int tb_exit = 0; > ... while now it is zeroed in each iteration of the for loop. > I'm not sure whether the new code is still correct.
That is okay because 'tb_exit' only makes sense when "last_tb != NULL". But we always reset 'last_tb' in this loop: last_tb = NULL; /* forget the last executed TB after exception */ > > If it is, ... > >> + >> /* prepare setjmp context for exception handling */ >> if (sigsetjmp(cpu->jmp_env, 0) == 0) { > ... the declaration of tb_exit could also be done here, after the sigsetjmp. > That would fix a compiler warning which I get when compiling with > -Wclobbered: > > > cpu-exec.c:603:13: warning: variable ‘tb_exit’ might be clobbered by > ‘longjmp’ or ‘vfork’ [-Wclobbered] I've sent the patch to fix this: Message-Id: <20160715193123.28113-1-sergey.fedo...@linaro.org> Thanks, Sergey