[clang] [Clang][CodeGen][UBSan] Add more precise attributes to recoverable ubsan handlers (PR #130990)

Eli Friedman via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 31 12:25:46 PDT 2025


efriedma-quic wrote:

> The ubsan handler cannot be eliminated because inaccessiblemem: readwrite indicates that it has externally observable side effects.

That is not how things work.  For example:

```
$ echo "declare void @g() define void @f() nounwind { call void @g() memory(argmem: read, inaccessiblemem: readwrite) willreturn unreachable }" | opt -O3 -S
; ModuleID = '<stdin>'
source_filename = "<stdin>"

; Function Attrs: mustprogress nofree norecurse noreturn nosync nounwind willreturn memory(none)
define void @f() local_unnamed_addr #0 {
  unreachable
}

attributes #0 = { mustprogress nofree norecurse noreturn nosync nounwind willreturn memory(none) }
```


https://github.com/llvm/llvm-project/pull/130990


More information about the cfe-commits mailing list