[PATCH] D50519: [sanitizer] Remove rsp from the clobber list in internal_clone

Kostya Kortchinsky via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 9 10:18:12 PDT 2018


cryptoad created this revision.
cryptoad added reviewers: eugenis, vitalybuka.
Herald added subscribers: Sanitizers, llvm-commits, delcypher, kubamracek.

When compiling with WERROR=ON, a new fatal warning started popping up recently
(due to -Werror,-Winline-asm):

  .../lib/sanitizer_common/sanitizer_linux.cc:1214:24: error: inline asm clobber list contains reserved registers: RSP [-Werror,-Winline-asm]
                         "syscall\n"
                         ^
  <inline asm>:1:1: note: instantiated into assembly here
          syscall
  ^
  .../lib/sanitizer_common/sanitizer_linux.cc:1214:24: note: Reserved registers on the clobber list may not be preserved across the asm statement, and clobbering them may lead to undefined behaviour.
                         "syscall\n"
                         ^
  <inline asm>:1:1: note: instantiated into assembly here
          syscall
  ^

Removing `rsp` from the clobber list makes the warning go away, and does not
appear to have a functional impact. If there is another way to solve this, let
me know.


Repository:
  rCRT Compiler Runtime

https://reviews.llvm.org/D50519

Files:
  lib/sanitizer_common/sanitizer_linux.cc


Index: lib/sanitizer_common/sanitizer_linux.cc
===================================================================
--- lib/sanitizer_common/sanitizer_linux.cc
+++ lib/sanitizer_common/sanitizer_linux.cc
@@ -1244,7 +1244,7 @@
                          "d"(parent_tidptr),
                          "r"(r8),
                          "r"(r10)
-                       : "rsp", "memory", "r11", "rcx");
+                       : "memory", "r11", "rcx");
   return res;
 }
 #elif defined(__mips__)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D50519.159950.patch
Type: text/x-patch
Size: 493 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180809/0fea1dfb/attachment.bin>


More information about the llvm-commits mailing list