[compiler-rt] [llvm] [msan] Add 32-bit platforms support (PR #109284)
via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 12 07:01:58 PST 2024
================
@@ -111,11 +113,28 @@ define dso_local i64 @many_args() {
; CHECK-NEXT: store i64 0, ptr inttoptr (i64 add (i64 ptrtoint (ptr @__msan_param_tls to i64), i64 776) to ptr), align 8
; CHECK-NEXT: store i64 0, ptr inttoptr (i64 add (i64 ptrtoint (ptr @__msan_param_tls to i64), i64 784) to ptr), align 8
; CHECK-NEXT: store i64 0, ptr inttoptr (i64 add (i64 ptrtoint (ptr @__msan_param_tls to i64), i64 792) to ptr), align 8
+; CHECK-NEXT: store i64 0, ptr @__msan_va_arg_tls, align 8
; CHECK-NEXT: store i64 0, ptr inttoptr (i64 add (i64 ptrtoint (ptr @__msan_va_arg_tls to i64), i64 8) to ptr), align 8
; CHECK-NEXT: store i64 0, ptr inttoptr (i64 add (i64 ptrtoint (ptr @__msan_va_arg_tls to i64), i64 16) to ptr), align 8
; CHECK-NEXT: store i64 0, ptr inttoptr (i64 add (i64 ptrtoint (ptr @__msan_va_arg_tls to i64), i64 24) to ptr), align 8
; CHECK-NEXT: store i64 0, ptr inttoptr (i64 add (i64 ptrtoint (ptr @__msan_va_arg_tls to i64), i64 32) to ptr), align 8
; CHECK-NEXT: store i64 0, ptr inttoptr (i64 add (i64 ptrtoint (ptr @__msan_va_arg_tls to i64), i64 40) to ptr), align 8
+; CHECK-NEXT: store i64 0, ptr inttoptr (i64 add (i64 ptrtoint (ptr @__msan_va_arg_tls to i64), i64 48) to ptr), align 8
----------------
k-kashapov wrote:
I guess, this comes from [System V ABI 64-bit](https://cs61.seas.harvard.edu/site/pdf/x86-64-abi-20210928.pdf) part 3.5.7 and [System V ABI 32-bit](https://refspecs.linuxbase.org/elf/abi386-4.pdf) page 167:
* On x86_64 `va_list` is a struct and there is dedicated `register_overflow_area`. This area is used to pass shadow for arguments that don't fit into registers. In IR we observe it as increase in offset against `__msan_va_arg_tls` for 6th argument.
* On i386 `va_list` is a `void *` and it does not imply any space separation for shadow of arguments that are passed in registers and in memory. This behavior is similar to `GenericHelper`.
https://github.com/llvm/llvm-project/pull/109284
More information about the llvm-commits
mailing list