[commit: ghc] master: Revert "UNREG: use __builtin___clear_cache where available" (c6fe403)

git at git.haskell.org git at git.haskell.org
Wed Jun 21 21:16:48 UTC 2017


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/c6fe403ec714bf29cad9d94196f0db3c80a02235/ghc

>---------------------------------------------------------------

commit c6fe403ec714bf29cad9d94196f0db3c80a02235
Author: Sergei Trofimovich <slyfox at gentoo.org>
Date:   Wed Jun 21 22:15:22 2017 +0100

    Revert "UNREG: use __builtin___clear_cache where available"
    
    This reverts commit 6dd1257fdd4d18e84d32e89bf0ec664b3c8f7b93.
    
    Change fails vaildation:
      rts/sm/Storage.c:1351:20: error:
         error: ‘gcc_clear_cache’ defined but not used [-Werror=unused-function]
         STATIC_INLINE void gcc_clear_cache(void * begin, void * end)


>---------------------------------------------------------------

c6fe403ec714bf29cad9d94196f0db3c80a02235
 rts/sm/Storage.c | 22 +---------------------
 1 file changed, 1 insertion(+), 21 deletions(-)

diff --git a/rts/sm/Storage.c b/rts/sm/Storage.c
index 2e2834b..4aa4b12 100644
--- a/rts/sm/Storage.c
+++ b/rts/sm/Storage.c
@@ -1341,26 +1341,6 @@ StgWord calcTotalCompactW (void)
 #include <libkern/OSCacheControl.h>
 #endif
 
-#if defined(__GNUC__)
-/* __clear_cache is a libgcc function.
- * It existed before __builtin___clear_cache was introduced.
- * See Trac #8562.
- */
-extern void __clear_cache(char * begin, char * end);
-
-STATIC_INLINE void gcc_clear_cache(void * begin, void * end)
-{
-    /* __builtin___clear_cache is supported since GNU C 4.3.6.
-     * We pick 4.4 to simplify condition a bit.
-     */
-#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)
-    __builtin___clear_cache(begin, end);
-#else
-    __clear_cache(begin, end);
-#endif
-}
-#endif /* __GNUC__ */
-
 /* On ARM and other platforms, we need to flush the cache after
    writing code into memory, so the processor reliably sees it. */
 void flushExec (W_ len, AdjustorExecutable exec_addr)
@@ -1376,7 +1356,7 @@ void flushExec (W_ len, AdjustorExecutable exec_addr)
   /* For all other platforms, fall back to a libgcc builtin. */
   unsigned char* begin = (unsigned char*)exec_addr;
   unsigned char* end   = begin + len;
-  gcc_clear_cache((void*)begin, (void*)end);
+  __clear_cache((void*)begin, (void*)end);
 #else
 #error Missing support to flush the instruction cache
 #endif



More information about the ghc-commits mailing list