Commit 1538800276aa7228d74f9d00bf275f54dc9e9b43
1 parent
6a36d84e
workaround for gcc bug on PowerPC
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1726 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
1 changed file
with
9 additions
and
7 deletions
cpu-exec.c
... | ... | @@ -126,7 +126,7 @@ static TranslationBlock *tb_find_slow(target_ulong pc, |
126 | 126 | /* cannot fail at this point */ |
127 | 127 | tb = tb_alloc(pc); |
128 | 128 | /* don't forget to invalidate previous TB info */ |
129 | - T0 = 0; | |
129 | + tb_invalidated_flag = 1; | |
130 | 130 | } |
131 | 131 | tc_ptr = code_gen_ptr; |
132 | 132 | tb->tc_ptr = tc_ptr; |
... | ... | @@ -144,12 +144,6 @@ static TranslationBlock *tb_find_slow(target_ulong pc, |
144 | 144 | tb_link_phys(tb, phys_pc, phys_page2); |
145 | 145 | |
146 | 146 | found: |
147 | - if (tb_invalidated_flag) { | |
148 | - /* as some TB could have been invalidated because | |
149 | - of memory exceptions while generating the code, we | |
150 | - must recompute the hash index here */ | |
151 | - T0 = 0; | |
152 | - } | |
153 | 147 | /* we add the TB in the virtual pc hash table */ |
154 | 148 | env->tb_jmp_cache[tb_jmp_cache_hash_func(pc)] = tb; |
155 | 149 | spin_unlock(&tb_lock); |
... | ... | @@ -201,6 +195,14 @@ static inline TranslationBlock *tb_find_fast(void) |
201 | 195 | if (__builtin_expect(!tb || tb->pc != pc || tb->cs_base != cs_base || |
202 | 196 | tb->flags != flags, 0)) { |
203 | 197 | tb = tb_find_slow(pc, cs_base, flags); |
198 | + /* Note: we do it here to avoid a gcc bug on Mac OS X when | |
199 | + doing it in tb_find_slow */ | |
200 | + if (tb_invalidated_flag) { | |
201 | + /* as some TB could have been invalidated because | |
202 | + of memory exceptions while generating the code, we | |
203 | + must recompute the hash index here */ | |
204 | + T0 = 0; | |
205 | + } | |
204 | 206 | } |
205 | 207 | return tb; |
206 | 208 | } | ... | ... |