summaryrefslogtreecommitdiff
path: root/cpu-exec.c
diff options
context:
space:
mode:
authorbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2005-12-19 01:42:32 +0000
committerbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2005-12-19 01:42:32 +0000
commit1538800276aa7228d74f9d00bf275f54dc9e9b43 (patch)
tree12853df95973a7593d5bc88462f6638a536d3e53 /cpu-exec.c
parent6a36d84e1024ce41860751b449727f4ddca91aa2 (diff)
downloadqemu-1538800276aa7228d74f9d00bf275f54dc9e9b43.tar.gz
qemu-1538800276aa7228d74f9d00bf275f54dc9e9b43.tar.bz2
qemu-1538800276aa7228d74f9d00bf275f54dc9e9b43.zip
workaround for gcc bug on PowerPC
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1726 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'cpu-exec.c')
-rw-r--r--cpu-exec.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/cpu-exec.c b/cpu-exec.c
index 740037e4bb..1ec49c2d6a 100644
--- a/cpu-exec.c
+++ b/cpu-exec.c
@@ -126,7 +126,7 @@ static TranslationBlock *tb_find_slow(target_ulong pc,
/* cannot fail at this point */
tb = tb_alloc(pc);
/* don't forget to invalidate previous TB info */
- T0 = 0;
+ tb_invalidated_flag = 1;
}
tc_ptr = code_gen_ptr;
tb->tc_ptr = tc_ptr;
@@ -144,12 +144,6 @@ static TranslationBlock *tb_find_slow(target_ulong pc,
tb_link_phys(tb, phys_pc, phys_page2);
found:
- if (tb_invalidated_flag) {
- /* as some TB could have been invalidated because
- of memory exceptions while generating the code, we
- must recompute the hash index here */
- T0 = 0;
- }
/* we add the TB in the virtual pc hash table */
env->tb_jmp_cache[tb_jmp_cache_hash_func(pc)] = tb;
spin_unlock(&tb_lock);
@@ -201,6 +195,14 @@ static inline TranslationBlock *tb_find_fast(void)
if (__builtin_expect(!tb || tb->pc != pc || tb->cs_base != cs_base ||
tb->flags != flags, 0)) {
tb = tb_find_slow(pc, cs_base, flags);
+ /* Note: we do it here to avoid a gcc bug on Mac OS X when
+ doing it in tb_find_slow */
+ if (tb_invalidated_flag) {
+ /* as some TB could have been invalidated because
+ of memory exceptions while generating the code, we
+ must recompute the hash index here */
+ T0 = 0;
+ }
}
return tb;
}