[sanitizer] Remove rsp from the clobber list in internal_clone
authorKostya Kortchinsky <kostyak@google.com>
Thu, 9 Aug 2018 20:01:11 +0000 (20:01 +0000)
committerKostya Kortchinsky <kostyak@google.com>
Thu, 9 Aug 2018 20:01:11 +0000 (20:01 +0000)
commitd2214053a2d6d0d1a424fa41b618aa876ea34ff8
tree62655189ce64a385c7285ffa0a7c646cfc79d73f
parentcf40ba82843faf215891e46de1a8eb092ea9d693
[sanitizer] Remove rsp from the clobber list in internal_clone

Summary:
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.

Reviewers: eugenis, vitalybuka

Reviewed By: eugenis

Subscribers: kubamracek, delcypher, llvm-commits, #sanitizers

Differential Revision: https://reviews.llvm.org/D50519

llvm-svn: 339370
compiler-rt/lib/sanitizer_common/sanitizer_linux.cc