https://bugs.llvm.org/show_bug.cgi?id=43128
Bug ID: 43128
Summary: rbp being used as a scratch register
Product: libraries
Version: trunk
Hardware: PC
OS: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: Backend: X86
Assignee: unassignedb...@nondot.org
Reporter: ndesaulni...@google.com
CC: craig.top...@gmail.com, llvm-bugs@lists.llvm.org,
llvm-...@redking.me.uk, spatel+l...@rotateright.com
Blocks: 4068
Created attachment 22435
--> https://bugs.llvm.org/attachment.cgi?id=22435&action=edit
x.c
>From this discussion on LKML: https://lkml.org/lkml/2019/8/27/837
it seems that clang-9 and newer are using %rbp as a scratch register in leaf
functions (regardless of -fomit-frame-pointer/-fno-omit-frame-pointer).
A custom object file validator in the kernel is warning that due to this
codegen, it may not be able to unwind correctly through leaf functions.
A test case from Arnd is attached.
$ clang -c x.c -O2 -fomit-frame-pointer
$ llvm-objdump -d x.o | grep -e rbp -e ebp -e bp -e bpl
0: 55 pushq %rbp
60: 0f b6 ef movzbl %bh, %ebp
68: 33 1c aa xorl (%rdx,%rbp,4), %ebx
73: 0f b6 ef movzbl %bh, %ebp
79: 33 1c aa xorl (%rdx,%rbp,4), %ebx
95: 5d popq %rbp
Referenced Bugs:
https://bugs.llvm.org/show_bug.cgi?id=4068
[Bug 4068] [Meta] Compiling the Linux kernel with clang
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs