[llvm] [BOLT][runtime] add missing syscall clobbers to x86_64 __prctl. (PR #192790)

David CARLIER via llvm-commits llvm-commits at lists.llvm.org
Sat Apr 18 06:43:16 PDT 2026


https://github.com/devnexen created https://github.com/llvm/llvm-project/pull/192790

syscall clobbers RCX and R11; matches the aarch64/riscv64 wrappers.

>From b7570ffcadf36561f85ac64a2a9674d480f5ef07 Mon Sep 17 00:00:00 2001
From: David Carlier <devnexen at gmail.com>
Date: Sat, 18 Apr 2026 14:42:27 +0100
Subject: [PATCH] [BOLT][runtime] add missing syscall clobbers to x86_64
 __prctl.

syscall clobbers RCX and R11; matches the aarch64/riscv64 wrappers.
---
 bolt/runtime/sys_x86_64.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bolt/runtime/sys_x86_64.h b/bolt/runtime/sys_x86_64.h
index 933e939012481..859b7d717d7c7 100644
--- a/bolt/runtime/sys_x86_64.h
+++ b/bolt/runtime/sys_x86_64.h
@@ -350,7 +350,7 @@ int __prctl(int Option, unsigned long Arg2, unsigned long Arg3,
                        "syscall\n"
                        : "=a"(Ret)
                        : "D"(Option), "S"(Arg2), "d"(rdx), "r"(r10), "r"(r8)
-                       :);
+                       : "cc", "rcx", "r11", "memory");
   return Ret;
 }
 



More information about the llvm-commits mailing list