Commit 9257a9e49c324145d4a34d6a3a5ecffa16ddc063
1 parent
70a194b9
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
Showing
1 changed file
with
8 additions
and
5 deletions
exec.h
| @@ -225,11 +225,14 @@ TranslationBlock *tb_find_pc(unsigned long pc_ptr); | @@ -225,11 +225,14 @@ TranslationBlock *tb_find_pc(unsigned long pc_ptr); | ||
| 225 | #if defined(__powerpc__) | 225 | #if defined(__powerpc__) |
| 226 | 226 | ||
| 227 | /* on PowerPC we patch the jump instruction directly */ | 227 | /* on PowerPC we patch the jump instruction directly */ |
| 228 | -#define JUMP_TB(tbparam, n, eip)\ | 228 | +#define JUMP_TB(opname, tbparam, n, eip)\ |
| 229 | do {\ | 229 | do {\ |
| 230 | - static void __attribute__((unused)) *__op_label ## n = &&label ## n;\ | ||
| 231 | - asm volatile ("b %0" : : "i" (&__op_jmp ## n));\ | ||
| 232 | -label ## n:\ | 230 | + asm volatile (".section \".data\"\n"\ |
| 231 | + "__op_label" #n "." stringify(opname) ":\n"\ | ||
| 232 | + ".long 1f\n"\ | ||
| 233 | + ".previous\n"\ | ||
| 234 | + "b __op_jmp" #n "\n"\ | ||
| 235 | + "1:\n");\ | ||
| 233 | T0 = (long)(tbparam) + (n);\ | 236 | T0 = (long)(tbparam) + (n);\ |
| 234 | EIP = eip;\ | 237 | EIP = eip;\ |
| 235 | EXIT_TB();\ | 238 | EXIT_TB();\ |
| @@ -239,7 +242,7 @@ label ## n:\ | @@ -239,7 +242,7 @@ label ## n:\ | ||
| 239 | 242 | ||
| 240 | /* jump to next block operations (more portable code, does not need | 243 | /* jump to next block operations (more portable code, does not need |
| 241 | cache flushing, but slower because of indirect jump) */ | 244 | cache flushing, but slower because of indirect jump) */ |
| 242 | -#define JUMP_TB(tbparam, n, eip)\ | 245 | +#define JUMP_TB(opname, tbparam, n, eip)\ |
| 243 | do {\ | 246 | do {\ |
| 244 | static void __attribute__((unused)) *__op_label ## n = &&label ## n;\ | 247 | static void __attribute__((unused)) *__op_label ## n = &&label ## n;\ |
| 245 | static void __attribute__((unused)) *dummy ## n = &&dummy_label ## n;\ | 248 | static void __attribute__((unused)) *dummy ## n = &&dummy_label ## n;\ |