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,7 +126,7 @@ static TranslationBlock *tb_find_slow(target_ulong pc, | ||
| 126 | /* cannot fail at this point */ | 126 | /* cannot fail at this point */ |
| 127 | tb = tb_alloc(pc); | 127 | tb = tb_alloc(pc); |
| 128 | /* don't forget to invalidate previous TB info */ | 128 | /* don't forget to invalidate previous TB info */ |
| 129 | - T0 = 0; | 129 | + tb_invalidated_flag = 1; |
| 130 | } | 130 | } |
| 131 | tc_ptr = code_gen_ptr; | 131 | tc_ptr = code_gen_ptr; |
| 132 | tb->tc_ptr = tc_ptr; | 132 | tb->tc_ptr = tc_ptr; |
| @@ -144,12 +144,6 @@ static TranslationBlock *tb_find_slow(target_ulong pc, | @@ -144,12 +144,6 @@ static TranslationBlock *tb_find_slow(target_ulong pc, | ||
| 144 | tb_link_phys(tb, phys_pc, phys_page2); | 144 | tb_link_phys(tb, phys_pc, phys_page2); |
| 145 | 145 | ||
| 146 | found: | 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 | /* we add the TB in the virtual pc hash table */ | 147 | /* we add the TB in the virtual pc hash table */ |
| 154 | env->tb_jmp_cache[tb_jmp_cache_hash_func(pc)] = tb; | 148 | env->tb_jmp_cache[tb_jmp_cache_hash_func(pc)] = tb; |
| 155 | spin_unlock(&tb_lock); | 149 | spin_unlock(&tb_lock); |
| @@ -201,6 +195,14 @@ static inline TranslationBlock *tb_find_fast(void) | @@ -201,6 +195,14 @@ static inline TranslationBlock *tb_find_fast(void) | ||
| 201 | if (__builtin_expect(!tb || tb->pc != pc || tb->cs_base != cs_base || | 195 | if (__builtin_expect(!tb || tb->pc != pc || tb->cs_base != cs_base || |
| 202 | tb->flags != flags, 0)) { | 196 | tb->flags != flags, 0)) { |
| 203 | tb = tb_find_slow(pc, cs_base, flags); | 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 | return tb; | 207 | return tb; |
| 206 | } | 208 | } |