-static inline void gen_stop_exception(DisasContext *ctx)
+static inline void gen_end_tb_exception(DisasContext *ctx, uint32_t
+excp)
{
- gen_update_nip(ctx, ctx->base.pc_next);
- ctx->exception = POWERPC_EXCP_STOP;
+ /* No need to update nip for SYNC/BRANCH, as execution flow will change
*/
+ if ((excp != POWERPC_EXCP_SYNC) &&
+ (excp != POWERPC_EXCP_BRANCH))
+ {
+ gen_update_nip(ctx, ctx->base.pc_next);
+ }
+ ctx->exception = excp;
+ ctx->base.is_jmp = DISAS_NORETURN;
}
Hmm. You didn't actually raise the exception, so you can't set
DISAS_NORETURN that way. It looks like you should be using
gen_exception_nip().
This is reproducing the behavior that was implemented before the DISAS_NORETURN
changes, that caused check-tcg to fail with an assertion otherwise.
IIUC, POWERPC_EXCP_{STOP,SYNC,BRANCH} are not really exceptions and, in these cases,
ctx->exception is being used just to cause ppc_tr_translate_insn() to end the
translation block. If so, we should not be using ctx->exception for that, but I
believe fixing that to not use ctx->exception belongs in a separate stand-alone patch.