summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2003-08-11 22:21:18 +0000
committerbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2003-08-11 22:21:18 +0000
commit9257a9e49c324145d4a34d6a3a5ecffa16ddc063 (patch)
tree8a7dca16dd4dba9ee72e0b87e4b6022a89d1de1c
parent70a194b930797263bd6cb962d7f09596a07b4fef (diff)
downloadqemu-9257a9e49c324145d4a34d6a3a5ecffa16ddc063.tar.gz
workaround for gcc 3.3 bug or overoptimisation if a label is not used
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@368 c046a42c-6fe2-441c-8c8c-71466251a162
-rw-r--r--exec.h13
1 files changed, 8 insertions, 5 deletions
diff --git a/exec.h b/exec.h
index 29779f99de..026daaabe8 100644
--- a/exec.h
+++ b/exec.h
@@ -225,11 +225,14 @@ TranslationBlock *tb_find_pc(unsigned long pc_ptr);
#if defined(__powerpc__)
/* on PowerPC we patch the jump instruction directly */
-#define JUMP_TB(tbparam, n, eip)\
+#define JUMP_TB(opname, tbparam, n, eip)\
do {\
- static void __attribute__((unused)) *__op_label ## n = &&label ## n;\
- asm volatile ("b %0" : : "i" (&__op_jmp ## n));\
-label ## n:\
+ asm volatile (".section \".data\"\n"\
+ "__op_label" #n "." stringify(opname) ":\n"\
+ ".long 1f\n"\
+ ".previous\n"\
+ "b __op_jmp" #n "\n"\
+ "1:\n");\
T0 = (long)(tbparam) + (n);\
EIP = eip;\
EXIT_TB();\
@@ -239,7 +242,7 @@ label ## n:\
/* jump to next block operations (more portable code, does not need
cache flushing, but slower because of indirect jump) */
-#define JUMP_TB(tbparam, n, eip)\
+#define JUMP_TB(opname, tbparam, n, eip)\
do {\
static void __attribute__((unused)) *__op_label ## n = &&label ## n;\
static void __attribute__((unused)) *dummy ## n = &&dummy_label ## n;\