[PATCH] D105728: [clang][Codegen] Directly lower `(*((volatile int *)(0))) = 0;` into a `call void @llvm.trap()`

Erich Keane via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 9 14:46:41 PDT 2021


erichkeane added a comment.

This seems logical to me.  The comment needs some love, so I made my best suggestion.



================
Comment at: clang/lib/CodeGen/CGExpr.cpp:1855
+    // If this is a simple volatile store to a null pointer (and said null
+    // pointre is not defined), then we have a common idiom "please crash now".
+    // However, that is not the semantics LLVM IR provides, volatile operations
----------------



================
Comment at: clang/lib/CodeGen/CGExpr.cpp:1856
+    // pointre is not defined), then we have a common idiom "please crash now".
+    // However, that is not the semantics LLVM IR provides, volatile operations
+    // are not defined as trapping in LLVM IR, so this store will be
----------------



Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D105728/new/

https://reviews.llvm.org/D105728



More information about the llvm-commits mailing list