This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Patch] 4/3 i386 target support for __builtin___clear_cache()

This patch adds support for __builtin___clear_cache() to the i386 (and x86_64) target.

There is not much to see here. All I do is define the TARGET_BUILTIN_CLEAR_CACHE_INLINE_P target hook to always return false. This causes __builtin___clear_cache() to be a nop for this target.

Tested with bootstrap and make -k check with no regressions on x86_64-unknown-linux-gnu.

OK to commit if the target independent portion of the patch is approved?

2007-07-04 David Daney <>

   * config/i386/i386.h (TARGET_BUILTIN_CLEAR_CACHE_INLINE_P): Define
   target hook.

Index: config/i386/i386.h
--- config/i386/i386.h	(revision 125997)
+++ config/i386/i386.h	(working copy)
@@ -1716,6 +1716,12 @@ typedef struct ix86_args {
   x86_initialize_trampoline ((TRAMP), (FNADDR), (CXT))
+/* We never need to clear the instruction cache.  Returning true will
+   prevent _builtin__clear_cache from expanding to a library call.
+   Since a "clear_cache" insn is not defined it will expand to
+   const0_rtx.  */
+#define TARGET_BUILTIN_CLEAR_CACHE_INLINE_P hook_bool_void_true
 /* Definitions for register eliminations.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]