This series of patches adds a new built-in __builtin_flush_icache. The first part is the target independent support. The second adds support to the MIPS back-end. And finally the third changes the MIPS libffi support to use the new builtin instead of making a library call. The prototype for the new built-in is: void __builtin_flush_icache(void *location, size_t len); As one might expect, it flushes the region of memory pointed to by location with length len from the instruction cache. The new builtin and the flush_icache insn would be the preferred mechanism to flushing the i-cache. Looking at the various targets, it seems possible that in addition my mips support, alpha, arc, arm, ia64, m32r, m68k, pa, rs6000, score, sparc, and xtensa could do something useful for __builtin_flush_icache. Bootstrapped and tested on x86_64-unknown-linux-gnu all default languages with no regressions. Also tested on: x86_64 cross to mipsel-linux --with-arch=mips32 i686 cross to mipsel-linux --with-arch=mips32r2 with no regressions. OK to commit? 2007-06-30 David Daney * builtins.def (BUILT_IN_FLUSH_ICACHE): New builtin. * builtins.c (expand_builtin_flush_icache): New function. (expand_builtin): Call expand_builtin_flush_icache for BUILT_IN_FLUSH_ICACHE. (fold_builtin_flush_icache): New function. (fold_builtin_2): Call fold_builtin_flush_icache for BUILT_IN_FLUSH_ICACHE. * testsuite/gcc.dg/builtins-64.c: New test. * testsuite/gcc.dg/builtins-65.c: New test. * doc/extend.texi (__builtin_flush_icache): Document new builtin.