qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] Confusion regarding temporaries with branch conditional
@ 2016-11-30  7:00 Nikunj A Dadhania
  2016-11-30  7:24 ` Peter Maydell
  2016-11-30 16:55 ` Alex Bennée
  0 siblings, 2 replies; 9+ messages in thread
From: Nikunj A Dadhania @ 2016-11-30  7:00 UTC (permalink / raw)
  To: rth, qemu-devel


Hi,

I was writing one instruction and hit following issue:

[snip]/qemu/tcg/tcg.c:2039: tcg fatal error
qemu-ppc64le: [snip]/qemu/translate-all.c:175: tb_lock: Assertion `!have_tb_lock' failed.
Segmentation fault (core dumped)

Debugging deeper found that its something to do with the variable type:

    TCGv nb = tcg_temp_new();
    tcg_gen_andi_tl(nb, cpu_gpr[rB(ctx->opcode)], 0xFF);
    tcg_gen_brcondi_tl(TCG_COND_EQ, nb, 0, l1);
    [ Do something here]
    gen_set_label(l1);
    tcg_temp_free(nb);

If I change the variable as "local temporary", the code works fine:

    TCGv nb = tcg_temp_local_new();
    tcg_gen_andi_tl(nb, cpu_gpr[rB(ctx->opcode)], 0xFF);
    tcg_gen_brcondi_tl(TCG_COND_EQ, nb, 0, l1);
    [ Do something here]
    gen_set_label(l1);
    tcg_temp_free(nb);

I see lot of code that is using temporaries for similar operations,
example target-ppc/translate.c:gen_check_align(). How is that working,
is this a bug there as well?

Regards,
Nikunj

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2016-12-01  4:44 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-30  7:00 [Qemu-devel] Confusion regarding temporaries with branch conditional Nikunj A Dadhania
2016-11-30  7:24 ` Peter Maydell
2016-11-30  7:56   ` Nikunj A Dadhania
2016-11-30 17:08     ` Richard Henderson
2016-12-01  4:44       ` Nikunj A Dadhania
2016-11-30 16:55 ` Alex Bennée
2016-11-30 17:03   ` Richard Henderson
2016-11-30 18:12     ` Alex Bennée
2016-11-30 20:09       ` Richard Henderson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).