[PATCH] D37788: [ARM] builtins: Do not abort for NULL pointer in clear_cache.

Manoj Gupta via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 12 20:36:52 PDT 2017


manojgupta created this revision.
Herald added subscribers: kristof.beyls, aemerson.

__builtion___clear_cache maps to clear_cache function which calls abort()
when start address is not a NULL pointer.
clear_cache documentation in libgcc does not specify any aborting
behavior. And Libgcc implementation does not do abort for clear_cache.

Calling abort for a non-null start argument does not make any sense.
Neither libgcc docs does say that the start argument in clear_cache
has to be NULL. Fix by removing check for NULL pointer.

Fixes PR34588.


https://reviews.llvm.org/D37788

Files:
  lib/builtins/clear_cache.c


Index: lib/builtins/clear_cache.c
===================================================================
--- lib/builtins/clear_cache.c
+++ lib/builtins/clear_cache.c
@@ -121,9 +121,6 @@
                           : "=r"(start_reg)
                           : "r"(syscall_nr), "r"(start_reg), "r"(end_reg),
                             "r"(flags));
-         if (start_reg != 0) {
-             compilerrt_abort();
-         }
     #elif defined(_WIN32)
         FlushInstructionCache(GetCurrentProcess(), start, end - start);
     #else


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D37788.114961.patch
Type: text/x-patch
Size: 536 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170913/3239a591/attachment.bin>


More information about the llvm-commits mailing list