diff --git a/tcg/tcg.c b/tcg/tcg.c
index e0a9030..b5e274c 100644
--- a/tcg/tcg.c
+++ b/tcg/tcg.c
@@ -2120,7 +2120,12 @@ int tcg_gen_code(TCGContext *s, uint8_t *gen_code_buf)
    Return -1 if not found. */
 int tcg_gen_code_search_pc(TCGContext *s, uint8_t *gen_code_buf, long offset)
 {
-    return tcg_gen_code_common(s, gen_code_buf, offset);
+    int ret;
+    ret = tcg_gen_code_common(s, gen_code_buf, offset);
+    /* flush instruction cache */
+    flush_icache_range((unsigned long)gen_code_buf, 
+                       (unsigned long)s->code_ptr);
+    return ret;
 }
 
 #ifdef CONFIG_PROFILER
